Getting started with lazygit

Git is powerful. Git is also, let's be honest, kind of hostile. Even experienced developers sometimes stare at a merge conflict wondering if they should just rm -rf the repo and start over. The CLI works, but it demands that you hold a mental model of branches, staging areas, commit graphs, and reflog history all in your head at once.
lazygit takes that mental model and puts it on screen. It's a terminal UI for git created by Jesse Duffield โ not a replacement for the git CLI, but a visual layer on top of it that makes the common workflows dramatically faster and less error-prone. If you're comfortable in the terminal but tired of typing git log --oneline --graph to figure out where you are, lazygit might be the best tool you install this year.
Installing it
lazygit is available through all the usual package managers:
- macOS:
brew install lazygit - Arch Linux:
pacman -S lazygit - Ubuntu/Debian: Available via the official PPA or download the binary from GitHub releases
- Go users:
go install github.com/jesseduffield/lazygit@latest
Once installed, cd into any git repo and type lazygit. That's it. No config needed.
The panel layout
When lazygit opens, you'll see the screen divided into panels. This is the core mental model โ everything in lazygit happens within one of these panels.
The left side has a stack of narrow panels: Status (current branch info), Files (your working tree changes), Branches (local and remote), Commits (the log for your current branch), and Stash. The right side is a large preview pane that shows you the diff, commit details, or whatever is contextually relevant to your current selection.
You switch between panels with the number keys 1 through 5, or cycle through them with Tab. Inside any panel, you move up and down with j and k (or arrow keys). The preview pane updates as you navigate โ select a file and you see its diff, select a commit and you see what changed.
? always has the answer.The staging workflow
This is where lazygit earns its keep. The staging workflow replaces what is usually a tedious cycle of git status, git diff, git add, squint at the output, repeat.
The real power is in hunk staging. Press Enter on a file and you'll see its diff broken into hunks. Press Space to stage individual hunks, or use Tab to switch between staged and unstaged views. If you need even finer control, you can stage individual lines. This is what git add -p wishes it could be โ the same functionality but with a real visual interface instead of a y/n prompt loop.
Making commits
Once your changes are staged, committing is straightforward:
Press c, type your message, hit Enter, done. No git commit -m quoting gymnastics. If you realize you made a typo in your last commit message, jump to the Commits panel, select it, and press r to reword. This kind of quick correction used to mean remembering git commit --amend or git rebase -i โ in lazygit, it's a single keystroke.
Working with branches
The Branches panel (3) shows your local branches, remote branches, and tags in separate tabs. Switch between tabs with [ and ].
Switching branches is just navigating to the one you want and pressing Space. If you have uncommitted changes, lazygit will warn you and offer to stash them โ no surprise errors, no lost work.
Interactive rebase (the killer feature)
This is where lazygit genuinely shines. Interactive rebasing in the CLI means running git rebase -i, staring at a list of commits in your editor, changing pick to squash or reword, saving, and hoping you didn't mess up the order. In lazygit, you do it all visually.
Navigate to the Commits panel, and you can reorder commits by moving them with Ctrl-j and Ctrl-k. Squash with s, fixup with f, drop with d, reword with r. You see the result immediately in the commit list. If something goes wrong, z undoes the last action โ lazygit keeps its own undo history on top of git's reflog.
When to drop back to the CLI
lazygit handles the daily workflow brilliantly, but it's not a complete replacement for the git CLI. A few situations where you'll want to drop back:
- Complex merge conflicts that need manual editing across multiple files โ lazygit has a merge tool, but sometimes you just need your editor
- Git operations with unusual flags โ bisect with custom scripts, filter-branch, subtree operations
- Automation and scripting โ CI pipelines and git hooks still need the CLI
- When you need to understand what's happening โ if you're learning git itself, typing the commands helps you internalize the model
You can press e to open files in your editor directly from lazygit, and you can drop to a shell without leaving the UI. The two workflows complement each other.
Getting comfortable
The best way to learn lazygit is to open it in a real repo you're working on and just use it. Don't try to memorize shortcuts โ let ? be your guide for the first week. You'll naturally remember the keys you use most often, and the rest will come as you need them.
For a complete shortcut reference, check out our lazygit cheatsheet. The official lazygit wiki has detailed guides on specific workflows, and Jesse Duffield's YouTube demos are worth watching to see how a power user moves through the interface.
Git doesn't have to be painful. Give lazygit a week, and the only painful part will be wondering why you didn't try it sooner.