Skip to content

What lazygit Is

Git keeps the state of your work in several places at once: the files as they are on disk, the index — the staging area where the next commit is assembled — the current branch and its history, and the remote repositories your branches track. The git command answers questions about each of those, one at a time: git status for the files, git log for the history, git branch for the branches. Between one command and the next, the picture is in your head, and it goes stale the moment anything changes.

lazygit is a program that holds the whole picture on one screen at once, and lets you act on it directly. It is a terminal user interface — a full-screen program that runs in a terminal, drawn with box borders and driven from the keyboard. Down the left side sit panels for the repository's status, its changed files, its branches, its commits and its stash. The large panel on the right shows the details of whatever the left side has selected: a file's diff, a commit's whole patch, a branch's log. You move with the arrow keys or j and k, and the jobs you do all day are single keystrokes: Space stages a file, c commits, Space on a branch checks it out, z undoes the last thing you did.

Two facts about it matter more than any feature list.

It runs real git. lazygit is not a reimplementation of git and it has no repository format of its own. When you stage a file it runs git add, when you commit it runs git commit, and it shows its work in a small command log in the bottom-right corner of the screen, which names the actual command behind each action (chapter 2). Anything lazygit does, plain git could have done, and plain git can inspect afterwards — this guide's lab checked lazygit's work with git log and git status after nearly every session, and you can too.

It changes nothing about what git means. A commit made here is a commit. A merge conflict here is the same conflict, with the same marker lines in the same file, that git merge left you on the command line. lazygit's gift is speed and sight, not simplification: the model you need is git's model, and the companion guide Git for Mere Mortals teaches it. What lazygit removes is the friction — the re-typing of filenames, the forgotten flag, the status you ran six commands ago and have been misremembering since.

Why anyone would do this

  • The state is just there. Beginners lose work not to exotic failures but to not knowing what state they are in: unstaged edits forgotten, a commit made on the wrong branch. A screen that always shows branch, changes and recent commits makes those mistakes visible before they cost anything.
  • Tedious jobs become quick ones. Staging three of nine changed files on the command line is three filenames typed correctly. Here it is three presses of Space, with the diff of each file in front of you as you decide.
  • Scary jobs become approachable. Interactive rebasing, cherry-picking, resolving a merge conflict hunk by hunk: on the command line these are procedures with manuals. Here they are keys, menus, and a picture of what is about to happen — though chapter 16 is honest that approachable is not the same as safe.

The rule, stated before everything else

lazygit puts operations that used to require care and typing behind single keystrokes, including destructive ones: discarding changes, resetting branches, rewriting commits. Most of them ask first, and most of git is recoverable — but not all of it, and the exception matters enough to be this guide's rule:

Work in repositories that are yours, and commit before you experiment. The reflog can return almost anything you have committed; nothing can return what you never committed.

A commit you regret can be undone (chapter 8), amended (chapter 13), reverted, or dug out of the reflog — git's diary of everywhere your branches have pointed — days later. An edit you never committed exists in exactly one place, the file on disk, and the discard key (chapter 10) overwrites it without any diary entry at all. So the habit this guide teaches alongside every procedure is the cheap one: when you are about to try something you do not fully understand, commit first — or stash, chapter 9 — and experiment second. The lab obeyed the rule throughout: its repositories were built by a script, and anything the lab was about to break existed as a commit before the breaking started.

A first taste

After installing (chapter 3), in any folder that is a git repository:

lazygit

The screen fills with the panels of chapter 2. The lab's first screen, in its practice repository, is kept as transcript lazygit-lab/transcripts/t01-first-screen.txt; its top-left corner reads:

╭─[1]─Status──────────╮
│fixture → main       │
╰─────────────────────╯

That one small panel is the whole idea: the repository's name, an arrow, and the branch you are on — visible before, during and after everything else you do.

Check: q quits, from almost anywhere, and returns your terminal to you exactly as it was. Nothing in lazygit keeps running after it closes.

Who it is for

The developer who knows git's ideas but tires of its typing. The newcomer who can follow a diff on a screen more easily than a paragraph of command output, and who is safer with the state visible. The confident command-line user with one repository big enough, or one rebase fiddly enough, that a picture is worth a thousand flags. The common thread is one person, their own repositories, and work they would rather look at than remember.

What it is not

lazygit is not a git teacher: it labels things with git's own words — index, reflog, upstream — and assumes they mean something to you, or soon will. It is not a hosting client: there are no pull requests, issues or releases in it, because those belong to services, not to git. It is not a merge tool for every case: chapter 11 shows it resolving a text conflict by choosing sides, and chapter 16 names the conflicts that still belong in an editor. And it is not a sandbox: every key in this guide acts on your real repository, immediately, which is precisely why the rule above comes first.