I normally use only a few git commands each time I want to commit changes to a repository:

$ git add --all .
$ git commit -m "update."
$ git push -u origin master

Can magit be useful in this regard? M-x magit-status seems helpful but I am not fulling understanding the language of "staging/unstaging" "hunks" etc. from ref1 ref2 ref3.

What might be the equivalent commands in magit? Thanks in advance -

Edit This page seems to speak better to my level but is C-u s the equivalent of git add --all .? Though that page says it does not work.

  • S stages all files
  • c c initiates a commit. Write the message and then press C-c C-c to actually create the commit.
  • P u pushes to the upstream branch. In the popup that appears after you have pressed P you can see the upstream. If the upstream is not set yet, then you can still use P u. You'll be asked for a branch which is then configured as the upstream before pushing.
| improve this answer | |

This one is also quite easy technique to use without learning shortcuts of magit by using hydra.

(defhydra yt-hydra/help (:color blue :hint nil)
_mp_ magit-push #_mc_ magit-commit #_md_ magit diff #_mla_ magit diff #_mla_ magit status
  ;;Magit part
  ("mp" magit-push)
  ("mc" magit-commit)
  ("md" magit-diff)
  ("mla" magit-log-all)
  ("ms" magit-status)
(global-set-key (kbd "<f1>") 'yt-hydra/help/body)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.