Most people know about eight git commands and reach for a search engine for everything else. That is a reasonable strategy, because the commands you need rarely — interactive rebase, partial staging, moving a commit, un-stashing the right thing — are exactly the ones with the least memorable syntax. lazygit is a terminal interface that makes those operations a keypress instead of a lookup.
Is it worth your time? Yes, if you already understand git and find yourself doing fiddly things with it — staging half a file, tidying a branch before review, rescuing work from a stash. No if you are still learning git. You will learn lazygit’s keybindings instead of git’s model, and then every tutorial, every CI pipeline, every colleague’s instruction and every error message will be in a vocabulary you do not have. Learn the tool that everything else speaks first; add this when the commands have stopped being the hard part.
What it actually is
A full-screen terminal application that runs alongside your repository. The left is a column of panels — status, files, branches, commits, stash — and the right shows the diff or detail for whatever is selected. You move between panels with Tab, select with the arrow keys, and act with single letters.
Underneath, it is running ordinary git commands. Nothing it does is unavailable from the command line, and it keeps a log of the commands it has issued, which is both reassuring and a decent way to learn the syntax you keep forgetting.
sudo apt install lazygit # Debian, Ubuntu
sudo dnf install lazygit
sudo pacman -S lazygit
lazygit # in any repository. Press ? for the keys.? is the whole manual. It opens a context-sensitive list of every key available in the panel you are in, and it is the only thing you need to remember on the first day. Everything below is a shortcut to the parts worth knowing about.
The twenty percent you will use
| You want | Do this | Instead of |
|---|---|---|
| Stage a file | Space on it | git add file |
| Stage some lines of a file | Enter into it, then Space on the lines | git add -p and its single-letter prompts |
| Commit | c | git commit -m |
| Amend the last commit | A | git commit --amend |
| Push and pull | P and p | git push / git pull |
| Reword an old commit message | Select it in the commits panel, r | An interactive rebase |
| Squash a commit into the one before | Select it, s | An interactive rebase |
| Reorder commits | Select one, Ctrl+J / Ctrl+K | Editing a rebase to-do file |
| Stash everything | s in the files panel | git stash |
| Look through stashes and apply one | The stash panel | git stash list, then counting |
| Resolve a conflict | Enter the conflicted file | Editing markers by hand |
Two of those are the actual reason to install it.
Line-level staging. git add -p does the same job by showing you a hunk and asking a yes/no question, with a separate key for splitting a hunk that never quite splits where you wanted. In lazygit you see the diff, move the cursor to the lines you want, and press Space. Committing a bug fix without the four unrelated changes sitting in the same file goes from a chore to something you do without thinking about it.
Interactive rebase without the to-do file. Squashing, rewording and reordering are the same operations git offers, minus the step where you edit a list of instructions in an editor and hope you have not mistyped one. Selecting a commit and pressing a key is a considerably lower-stakes way to tidy a branch.
Gotchas
| Thing | What to know |
|---|---|
| It rewrites history for real | Squashing a pushed commit still needs a force push, with all the usual consequences for everyone else |
| Undo exists | Backed by the reflog, so most mistakes are recoverable — check ? for the key in your version |
| Slow on very large repositories | It refreshes status frequently. gitui is faster on repositories with tens of thousands of files |
| Commit messages open your editor | Whatever $EDITOR is set to. Set it deliberately |
| Diffs are plain by default | Point it at delta in its config and the diff panel becomes far more readable |
| Works over SSH | It is a terminal application, so a remote repository is no different — pair it with tmux |
That first row deserves emphasis. lazygit makes history rewriting easy, which is welcome on a local branch and dangerous on a shared one. The tool has no idea which is which. The rule is unchanged: rewrite freely before you push, and think carefully afterwards.
Where it does not belong
- Scripts and CI. Obviously — it is interactive. Anything automated uses
git. - Learning git. Covered above, and it is the important one. The mental model — what a commit is, what a branch is, what the index is for — does not come from a UI that hides all three.
- Explaining something to a colleague. “Press
sthenCtrl+J” helps nobody who is not running the same tool. Send the command. - Anything you need to reproduce exactly. Take the command out of its log and put that in your notes, not the keystrokes.
- A machine you do not control. It will not be installed, and the commands still have to be in your fingers.
Two neighbours worth knowing. tig is read-only and superb at browsing history and blame — a smaller, calmer tool if you never wanted the editing. gitui is a Rust equivalent that is noticeably faster on enormous repositories and covers less ground.
Quick reference
lazygit # start it in a repository
? # every key available here — the only one to memorise
Tab # move between panels
Space # stage or unstage the selection
Enter # go into a file to stage individual lines
c # commit A amend
p / P # pull / push
s # stash (files panel) or squash (commits panel)
q # quitRelated
- delta vs diff — worth configuring before you spend much time reading diffs anywhere
- tmux vs screen — for running it on a remote machine without losing the session
- fzf — the other way to stop typing exact names
- vim and nano — whichever one it opens for your commit messages
