Magit Reference Card
Getting help in Emacs
C-h k 〈key〉 describe function bound to 〈key〉
C-h b list the current key-bindings for the focus buffer
C-h m describe mode
C-h l show the keys you have pressed
〈prefix〉 C-h show all key-bindings beginning with 〈prefix〉
Section Movement Section Visibility
p previous section
n next section TAB toggle visibility of current section
P previous sibling section C-TAB cycle visibility of section and children
N next sibling section M-TAB cycle visibility of diff-related sections
ˆ parent section S-TAB cycle visibility of all sections in buffer
Staging Status/Diff/Log Buffer
s stage change at point SPC update commit/diff buffer or scroll up
u unstage change at point DEL update commit/diff buffer or scroll down
S stage all changes in worktree h show dispatch popup
U reset index to some commit g refresh
M-x magit-unstage-all remove all changes G refresh all
M-x magit-stage-file stage current file q bury current buffer
M-x magit-unstage-file unstage current file L toggle margin
x soft reset (hard when argument is given)
View Git Output y show references (tags and branches)
Y cherry
$ display process buffer for current repository C-c C-b move backward in buffer’s history
k kill process represented by section at point C-c C-f move forward in buffer’s history
Popups
! running git f fetching o submoduling
b branching F pulling r rebasing
B bisecting l logging w apply patches
c committing m merging W format patches
d diffing M remoting t tagging
E ediff P pushing z stashing
Status/Diff/Log Buffer References Buffer
y compare references with HEAD
e ediff DWIM
c compare references with current branch
i gitignore
o compare references with other branch
I gitignore locally
Blaming
Diff Buffer
M-x magit-blame display edit history of file
RET show the commit at point
RET visit file (or blob) at appropriate position
SPC update commit/diff buffer or scroll up
C-RET visit file at appropriate position
DEL update commit/diff buffer or scroll down
− decrease context of diff hunks
n move to the next chunk
+ increase context of diff hunks N move to the next chunk (same commit)
0 reset context of diff hunks to default height p move to the previous chunk
j jump to diff stat ↔ diff section P move to the previous chunk (same commit)
q turn off magit blame mode
Log Buffer t show or hide blame chunk headings
Repository Setup
+ show more history
C-c C-c select commit at point and act on it M-x magit-init initialize a Git repository
C-c C-k abort selecting commit M-x magit-clone clone a repository