Magit keybindings
Having decided that Magit is the bee’s knees you’ll probably want to know the keyboard shortcuts. Here are the most common ones:
C-c g
Start magit (M-x magit-status)s
Stage fileS
Stage all filesu
Unstage filec
Commit staged files.C-c C-c
after writing commit message orC-c C-k
to abort.C-c C-a
sdlkfjlkdfjb b
To switch to a branchb m
Rename branchb d
Delete branchb v
List branches (can checkout from resultant screen using RET)P P
Git pushf f
Git fetchF F
Git pullTAB
Shows diff of file in the list or expand collapse section. Stage and unstage actually work on bits of the diff as well.i
Ignore file (adds to .gitignore)k
Delete. Deletes untracked file and stashes (on section header it deletes all untracked files). If you’re positioned in a diff for an uncommited file you can also delete just the hunk.l l
Show historyl L
Show history in verbose formatt t
Make lightweight tagt a
Make annotated tagx
Revert commit history to entered revisionz z
Create a stasha
Apply a stashA
Apply the stash and pop it off the stash listz s
Creates a snapshot (the stash gets created but the working tree is not deleted.w
Show how other branches related to the current onem m
Start merging. In the event of conflicts resolve changes using e then stage with s.R
Starts a rebaseR c
will continue a rebase. Stage resolved conflicts before continuing.
Leave a Comment