lazygit cheatsheet

· Tech

A quick reference for the lazygit shortcuts I use most. Based on lazygit v0.60 defaults.

KeyAction
1-5Switch panels (Status/Files/Branches/Commits/Stash)
h / lSwitch panel sections (or Tab / Shift+Tab)
j / kMove down / up
EnterFocus selected item / expand
EscGo back / close
?Show all keybindings for current panel
/Search in current panel

Files panel

KeyAction
SpaceStage / unstage file
aStage / unstage all
cCommit staged changes
AAmend last commit
xDiscard changes (file)
eEdit file in editor
iAdd to .gitignore
EnterStage individual hunks/lines
GAI commit message (custom command, see AI commits post)

Staging mode (inside a file)

KeyAction
SpaceStage / unstage hunk
aStage / unstage entire file
vToggle line selection mode
TabSwitch between staged/unstaged
EscExit staging mode

Branches panel

KeyAction
SpaceCheckout branch
nNew branch
dDelete branch
MMerge into current branch
rRebase current branch onto selected
RRename branch
fFast-forward branch

Commits panel

KeyAction
sSquash commit into parent
fFixup commit (squash, discard message)
rReword commit message
dDrop commit
eEdit commit (start interactive rebase)
pPick commit (during rebase)
CCopy commit (cherry-pick)
VPaste (cherry-pick) copied commits
Ctrl+j / Ctrl+kMove commit down / up
gReset options for this commit

Stash

KeyAction
sStash changes (from Files panel)
gPop stash entry
dDrop stash entry

Global

KeyAction
PPush
pPull
zUndo (via reflog)
ZRedo
@Extras menu
:Custom command
Ctrl+rOpen recent repos
?Show keybindings
qQuit