User Guide

A deeper look at how lazygit works and how to use its main features. For a quick start, see Getting Started.

Navigation

KeyAction
Tab / shift+TabCycle between panels
1–5Jump directly to a panel
↑ / ↓ or j / kMove in a list
EnterDrill into selected item
EscGo back / close panel
?Show keybindings for current panel
qQuit

Files panel

The Files panel shows your working tree: unstaged changes at the top, staged below.

KeyAction
SpaceStage / unstage file
aStage all / unstage all
EnterOpen file diff to stage individual lines
dDiscard changes to file
eOpen file in editor
cCommit staged changes
AAmend last commit with staged changes

Staging individual lines

Press Enter on a file to open the hunk view, then:

KeyAction
SpaceStage / unstage selected line
vToggle visual (range) selection
aToggle line / hunk selection

Branches panel

KeyAction
SpaceCheckout selected branch
nCreate new branch
dDelete branch
rRebase current branch onto selected
MMerge selected into current branch
FForce checkout (discard local changes)

Commits panel

KeyAction
sSquash commit into previous
fFixup (squash, discard message)
rRename commit message
dDrop commit
eEdit commit (stops rebase at this point)
iStart interactive rebase for your branch's commits
ctrl+k / ctrl+jMove commit up / down
shift+cMark for cherry-pick
shift+vPaste cherry-picked commits

Undo & Redo

lazygit reads the git reflog to undo and redo actions on commits and branches. It can't undo changes to your working tree or stash, or anything you've pushed, and undo isn't available in the middle of a rebase.

KeyAction
zUndo last action
ZRedo

Filtering

Press / to filter the current panel by text. Works for branches, files, and stashes. In the Commits panel, it searches instead. Press Esc to clear.

Further reading