Skip to content

Instantly share code, notes, and snippets.

@AyakoGFX
Created September 11, 2024 13:38
Show Gist options
  • Select an option

  • Save AyakoGFX/9c7fbd42814d5798cb97fa66dea0d920 to your computer and use it in GitHub Desktop.

Select an option

Save AyakoGFX/9c7fbd42814d5798cb97fa66dea0d920 to your computer and use it in GitHub Desktop.
Magit keybind reference sheet "Doom Emacs" + Vanilla Key

Magit Keybind Reference Sheet

Entering Magit

Evil KeyVanilla KeyDescription
SPC ggC-c vgOpen magit-status in current project
There is also the :magit ex command for evil users.

Leaving Magit

  • To close a buffer or window you should use `q`
  • To close a popup (transients) you should use `C-g`

In File Commands

Evil KeyVanilla KeyDescription
SPC gsC-c vsStage the current hunk in the current file
SPC grC-c vrRevert the current hunk in the current file
SPC gBC-c vBInteractively blame a file

Basic Interaction

  • Everything in the status buffer is interactive. You can hit `RET` or `TAB` on almost anything in the buffer.
KeyDescription
TABToggle the current heading
RETExpand an item
sStage the current file/hunk
uUnstage the current item
SStage all changes
UUnstage all changes
ccCommit all staged changes
llOpen up the git log

Branching

KeyDescription
bbCheckout branch
bcCreate new branch
bxDelete branch
bsCreate a new branch from the last commit

Merge and Rebase

*** Merge

KeyDescription
mmMerge another branch into the current branch
miMerge the current branch into another branch

*** Rebase

KeyDescription
rpRebase onto the default remote
reRebase onto a different remote or branch

Remote

KeyDescription
MaAdd a remote
MxRemove a remote
MrRename a branch
MCConfigure a remote

*** Fetch

KeyDescription
fpFetch default remote
feFetch a different remote
faFetch all remotes

*** Pull

KeyDescription
FpPull the default remote
FePull from a different remote

*** Push

KeyDescription
ppPush to the default remote
pePush to a different remote

The Git Time Machine

The git time machine allows you to quickly go through a file’s commits and explore changes over time interactively.

Evil KeyVanilla KeyDescription
SPC gtC-c vtToggle the git time machine on the current file
C-jC-nShow the next revision
C-kC-pShow the previous revision
qQuit the time machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment