User Guide
A deeper look at how lazygit works and how to use its main features. For a quick start, see
Getting Started.
Navigation
| Key | Action |
Tab / shift+Tab | Cycle between panels |
1–5 | Jump directly to a panel |
↑ / ↓ or j / k | Move in a list |
Enter | Drill into selected item |
Esc | Go back / close panel |
? | Show keybindings for current panel |
q | Quit |
Files panel
The Files panel shows your working tree: unstaged changes at the top, staged below.
| Key | Action |
Space | Stage / unstage file |
a | Stage all / unstage all |
Enter | Open file diff to stage individual lines |
d | Discard changes to file |
e | Open file in editor |
c | Commit staged changes |
A | Amend last commit with staged changes |
Staging individual lines
Press Enter on a file to open the hunk view, then:
| Key | Action |
Space | Stage / unstage selected line |
v | Toggle visual (range) selection |
a | Toggle line / hunk selection |
Branches panel
| Key | Action |
Space | Checkout selected branch |
n | Create new branch |
d | Delete branch |
r | Rebase current branch onto selected |
M | Merge selected into current branch |
F | Force checkout (discard local changes) |
Commits panel
| Key | Action |
s | Squash commit into previous |
f | Fixup (squash, discard message) |
r | Rename commit message |
d | Drop commit |
e | Edit commit (stops rebase at this point) |
i | Start interactive rebase for your branch's commits |
ctrl+k / ctrl+j | Move commit up / down |
shift+c | Mark for cherry-pick |
shift+v | Paste 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.
| Key | Action |
z | Undo last action |
Z | Redo |
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