I know git well enough to fix most things from the command line, and I still use lazygit for ninety per cent of my day. It is a terminal UI over ordinary git: you see status, diffs, branches, stashes and the log at once, and you stage, commit, rebase and push with single keystrokes. No wrapper, no proprietary format, just git commands run for you.
Installing lazygit
macOS
brew install lazygit
Linux
Ubuntu 24.04 and Debian 13 package it, so the obvious command works:
sudo apt update && sudo apt install lazygit
On anything older — Ubuntu 22.04, Debian 12 — it is not in the archive and you install the binary yourself. It is a single Go binary, so this is painless:
LG_VER=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": *"v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LG_VER}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
lazygit --version
The keys that actually matter
There is a full cheatsheet on ?, but you can be productive with about a dozen keys. Panels are numbered 1 to 5 (status, files, branches, commits, stash), and Tab cycles them.
- Space — stage or unstage whatever is selected: a file, a hunk, a line, a branch checkout. It is the universal “do the obvious thing” key.
- Enter — descend into the selection. On a file this opens the hunk-by-hunk staging view.
- a stage everything, d discard, e edit in your editor.
- c commit, C commit in your editor for a long message, A amend the last commit.
- p pull, P push, n new branch from the selection.
- In the commits panel: s squash down, f fixup, r reword, d drop, Ctrl-j and Ctrl-k to move a commit up or down.
- z undo, Ctrl-z redo. It works through the reflog and it has saved me more than once.
The workflow that sells it: staging hunks
You have been working for an hour and the diff is now a bug fix, a rename and a stray debug log, all mixed together. On the command line that means git add -p and a stream of y/n/s/e prompts where you cannot see the whole file.
In lazygit: press 2 for files, Enter on the changed file, and you are looking at the diff with a cursor in it. Space stages the hunk under the cursor. v starts a line-wise selection so you can stage four lines out of a twelve-line hunk without editing a patch by hand. Tab flips between staged and unstaged views so you can check what you have built up. Then c, type the message, done — and repeat for the next logical commit.
The second workflow is tidying history before review. In the commits panel, s to squash a fixup into its parent, r to reword, Ctrl-j to reorder. lazygit drives an interactive rebase underneath and shows you the result immediately, so the feedback loop is a keystroke rather than an editor session and a re-read of the todo file.
Shell integration and config
alias lg='lazygit'
git config --global alias.lg '!lazygit'
The config lives at ~/.config/lazygit/config.yml on Linux and ~/Library/Application Support/lazygit/config.yml on macOS. Two settings are worth changing on day one — a delta pager for readable diffs, and nvim as the editor:
git:
paging:
colorArg: always
pager: delta --dark --paging=never
os:
editPreset: 'nvim'
gui:
showFileTree: true
nerdFontsVersion: '3'
When plain git is still the right call
- Anything automated. Scripts, hooks and CI use the git CLI. lazygit is for humans at a keyboard.
- Genuinely nasty surgery. Filter-branch style rewrites, submodule archaeology, recovering from a botched rebase — do those deliberately, with the plumbing commands and a backup branch.
- Large code review. A TUI is not the place to read a 2,000-line diff. That belongs in a full client or the forge’s review UI — I compared the options in the best git UI clients.
- Learning git. If you do not yet know what a rebase does, a tool that does it in one keystroke will teach you nothing useful.
The verdict
lazygit is the one tool here I would not work without. Install it, alias it to lg, and learn six keys: Space, Enter, c, P, z and ?. Keep the CLI for scripts and for surgery. Everything in between — the staging, the fixups, the branch hopping — is faster and less error-prone in the TUI, and you can see what you are doing.

Leave a Reply
You must be logged in to post a comment.