lazygit for Mere Mortals
Git asks you to hold a lot in your head at
once: which files changed, which of those
changes are staged, what the last commits
were, which branch you are on and how far
it has drifted from its remote. The
commands print one answer at a time, and
the picture falls apart between them.
lazygit keeps the whole picture on one
screen — files, branches, commits, stash —
and turns the commonest jobs into single
keystrokes: Space to stage, c to commit,
Space to check out a branch, z to undo.
Underneath, it does nothing mysterious. It
runs the same git commands you would
have typed, and it shows its work: a small
command log in the corner lists the real
commands as it runs them.
This guide explains how that screen is organised, how to stage and commit from it, how to move between branches and read history, how the stash, the undo key and the conflict view work, and how to talk to a remote — all on practice repositories built for the purpose. The limits are stated plainly, including the honest one: lazygit makes git quicker, not simpler. The model underneath is still git's model, and this guide teaches the tool, not a replacement for understanding that model.
One rule governs everything here, and it is stated in chapter 1 and repeated where it matters: work in repositories that are yours, and commit before you experiment — the reflog can return almost anything you have committed, and nothing can return what you never committed. The lab obeyed it. Every repository in this guide was invented, built by a script, and worked on on one machine; the one remote it ever talked to was a folder on the same disk.
The lab behind this guide ran the real thing: lazygit 0.66.2, installed from the project's release tarball with its checksum verified, driven in a real terminal — real keystrokes, screens captured after each step — against a small notes project with three branches and a pocketful of uncommitted changes. Against it the lab staged files one by one and all at once, committed through lazygit's own editor, checked branches out and created a new one, reworded a commit and watched its hash change, undid a commit with the undo key and read the exact reset it performed, stashed work and popped it back, threw a modification away through the discard menu, resolved a merge conflict hunk by hunk and concluded the merge, and pulled and pushed against a bare repository standing in for a remote. After nearly every session it asked plain git whether the promised change had really happened.
What the lab could not do, it did not
fake. Its remote never crossed a network,
so SSH keys and credential prompts are
taught from the documentation. Install
routes for other operating systems are
likewise documented, not demonstrated,
and the longest machinery — multi-commit
interactive rebases — is described with
its one-commit cousin, rewording, as the
part actually run. criteria.md keeps
the full ledger of what was run and what
was only read.
What this guide covers
- What lazygit is — the mental model: a window onto the repository you already have, the commands it really runs, and the rule about committing before you experiment
- The moving parts — the five numbered panels, the main panel, the hint bar, the command log, popups and menus, and where the configuration lives
- Installing lazygit — the release tarball and its checksum, the other routes for other systems, and the git it needs beside it
- Your first session — opening a repository, reading the whole screen, the welcome popup, and what happens outside a repository entirely
- Staging and committing — the Files panel, the two status columns, staging files, folders and everything, and the commit editor with its commit-all safety net
- Branches — checking out, creating in one motion, the error that stops you checking out the branch you are on, and what Enter does on a branch
- Reading history — the Commits panel, a commit's whole patch in the main panel, the branch log, and drilling from a branch to its commits to a commit's files
- Undo and the reflog —
the
zkey, the exact reset it proposes before it acts, redo as a hard reset with an auto-stash, and the reflog underneath it all - The stash — quick stash with a message, the five flavours in the options menu, apply versus pop versus drop, and the untracked files a plain stash leaves behind
- Discarding and resetting — the discard menu that describes itself, the reset menu with its three hardnesses, and why this chapter points back to chapter 1's rule
- Merge conflicts — the narrowed Files panel, the conflict view, picking hunks with single keys, lazygit staging the resolution, and the menu that concludes or aborts the merge
- Remotes — fetch, pull and push —
the ↑ and ↓ counts in the Status panel,
pandP, and what a real network remote adds that the lab's folder did not have - History surgery — rewording a commit, the squash, fixup, drop and edit keys and what they set in motion, amending, and the line between your history and history you have shared
- Making it yours — the configuration file and its printed defaults, changing the file tree into a flat list, keybindings of your own, and custom commands
- The neighbours — plain git itself, tig and gitk, the desktop clients, editor integrations and Magit: what each shows that lazygit doesn't, and vice versa
- Limits — the model it cannot teach, conflicts it cannot settle, credentials it does not hold, and the size of repository that slows it down
- Troubleshooting — the repository question at startup, the "No files staged" error with two different causes, the collapsed tree, keys a popup quietly eats, and the command log as the first diagnostic
- Glossary — the terms, collected in one place
What it doesn't cover
Git itself. This guide assumes you know, or are learning from Git for Mere Mortals, what a commit, a branch and a merge are; lazygit displays those things and acts on them, but it does not explain them, and neither does this guide beyond what a chapter needs. Hosting services — GitHub, GitLab and their pull requests — are outside the tool almost entirely, and outside this guide. Rewriting history that other people have already pulled is shown the door in chapter 13 rather than taught: the keys exist, the consequences are yours, and chapter 1's rule is the guide's whole position.
How to use this guide
Read chapter 1 for the model and the
rule, and chapter 2 before installing
anything — knowing which panel holds
what turns later confusion into a named
problem. Build the practice repositories
(lazygit-lab/mkfixture.sh) and take
chapter 4's first session in the same
sitting as the install, so the screen in
front of you matches the one the chapters
describe. Chapters 5 to 12 follow the
order of a working day: change, stage,
commit, branch, stash, untangle, sync.
Learn the ? key early; from chapter 2
on, it is the guide's answer to every
"what was that key?" — including the
ones this guide never mentions. The
lab's transcripts live in
lazygit-lab/transcripts/; its notes are
examples/lab-notes.txt and its handful
of outside-the-interface commands are
examples/commands.txt.
Part of the series
This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.
Related guides:
License
The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.