Terminal UI for git. Handles staging, committing, branching, rebasing, stashing, and merge conflicts -- all without memorizing git commands.
lg # alias for lazygitlazygit opens a 5-panel interface:
┌─────────────┬──────────────────────────────┐
│ Status │ │
├─────────────┤ │
│ Files │ Diff / Preview │
├─────────────┤ │
│ Branches │ │
├─────────────┤ │
│ Commits │ │
├─────────────┤ │
│ Stash │ │
└─────────────┴──────────────────────────────┘
Navigate panels with Tab / Shift+Tab or 1-5 keys.
| Key | Action |
|---|---|
Space |
Stage/unstage a file |
a |
Stage/unstage all files |
Enter |
View file diff (line-by-line staging available) |
c |
Commit staged changes |
A |
Amend last commit |
S |
Squash commits (in commits panel) |
- Select a file and press
Enterto view its diff - Navigate to specific hunks or lines
- Press
Spaceto stage individual lines/hunks - Press
Escto go back, thencto commit
This is the killer feature -- stage exactly the changes you want without git add -p.
| Key | Action |
|---|---|
n |
New branch |
Space |
Checkout branch |
d |
Delete branch |
M |
Merge into current |
r |
Rebase onto selected |
- Go to the Commits panel
- Navigate to the commit you want to rebase from
- Press
eto start interactive rebase sto squash,fto fixup,dto drop,rto reword- Once done, rebase applies automatically
| Key | Action |
|---|---|
s (in files panel) |
Stash changes |
Space (in stash panel) |
Apply stash |
g (in stash panel) |
Pop stash |
d (in stash panel) |
Drop stash |
When conflicts exist, lazygit shows a side-by-side view:
←/→to pick left (ours) or right (theirs)bto pick bothSpaceto pick individual hunks
lgto openato stage allcto commit, type message,EnterPto pushqto quit
lgto openSpaceon each file to stage, orEnterto stage specific linescto commit- Repeat for next logical commit
- Go to Commits panel
- Navigate to the commit
- Press
rto reword
| Task | Use |
|---|---|
| Quick status check | gs (alias) |
| Stage + commit everything | gaa && gcm "msg" (aliases) |
| Partial staging, rebasing, conflict resolution | lg (lazygit) |
| PR creation | ghpr (alias for gh CLI) |
lazygit excels at visual, interactive git operations. Aliases are faster for simple, known commands.