TL;DR:

  • lazygit is a terminal UI for git that lets you stage individual lines, manage branches, run interactive rebases, cherry-pick commits, and handle stashes — all from a visual interface that stays in the terminal
  • The learning curve is minimal: most operations have single-key shortcuts shown in the UI, and the context-sensitive help panel tells you what’s available at any point
  • Install it, alias lg to lazygit, and within a day it’ll replace most of your manual git commands

You don’t need a GUI git client if you use the terminal. That’s the usual argument, and it’s mostly right — but git add -p for selective staging, git rebase -i for squashing commits, and git log --oneline --graph for visualising history all have a usability ceiling that lazygit blows past.

lazygit is a Go-written terminal application from Jesse Duffield that’s been iterating since 2018. It’s not a GUI — it runs entirely in your terminal, works over SSH, and fits naturally into a tmux or Zellij layout. Think of it as an interactive shell around git that makes the visual operations visual.

Installation

# macOS
brew install lazygit

# Ubuntu / Debian
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep '"tag_name"' | sed -E 's/.*"v*([^"]+)".*/\1/')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin

# Go
go install github.com/jesseduffield/lazygit@latest

Add alias lg='lazygit' to your .bashrc or .zshrc. Open lazygit in any git repository with lg.

The Interface

lazygit opens with five panels: Status, Files, Branches, Commits, and Stash. Navigation is with arrow keys or h/j/k/l. At the bottom of the screen, a keybinding hint shows what’s available for the currently focused panel.

The ? key opens full keybinding help for the current panel. This is the thing that makes lazygit learnable in a way that raw git is not — you can discover operations as you need them rather than memorising flags.

Selective Staging

This is the operation that converts most people. Instead of git add -p, which presents you with a text prompt for each hunk, lazygit shows you the diff visually and lets you stage at three levels of granularity:

  • File level: Space to stage or unstage an entire file
  • Hunk level: Tab to the diff panel, navigate to a hunk, Enter to stage just that hunk
  • Line level: In the diff panel, v enters visual selection mode, select individual lines with arrow keys, then Space stages just those lines

Staging a specific set of lines from a messy working tree is something that takes multiple git add -p prompts and careful navigation in raw git. In lazygit, it’s a few keystrokes.

Interactive Rebase

Interactive rebase (git rebase -i) is one of git’s most powerful features and one of its worst interfaces — you’re dropped into a text editor with a table of commits and have to remember the abbreviations for each command.

In lazygit, you navigate to the Commits panel, position your cursor on any commit, and press i (or r depending on your version) to start an interactive rebase from that point. You can then:

  • s to squash a commit into the one above
  • e to mark a commit for editing (stop the rebase at that commit so you can amend it)
  • d to drop a commit entirely
  • r to reword a commit message
  • Move commits up and down with shift+j / shift+k

The changes apply when you confirm, and lazygit handles the rebase execution, pausing if there are conflicts and letting you resolve them in your editor.

Branch Management

The Branches panel shows local branches, remotes, and tags. From here you can:

  • Space to checkout a branch
  • n to create a new branch
  • d to delete a branch (with confirmation)
  • M to merge the selected branch into the current one
  • r to rebase the current branch onto the selected one
  • f to fetch

Switching between feature branches, rebasing onto updated main, and cleaning up merged branches are all faster here than at the command line — particularly because lazygit shows you the branch structure visually and handles the confirmation prompts interactively rather than as separate commands.

Cherry-Picking

Navigate to the Commits panel, select the commit you want, press c to mark it for cherry-pick (it gets highlighted), then switch to the target branch and press v to paste it. Multi-commit cherry-picks work the same way: mark multiple commits with c, switch branch, paste.

This is substantially faster than git log --oneline to find the hash, note it down, git checkout target-branch, git cherry-pick <hash>.

Stash Management

The Stash panel lists all stash entries with their messages. From here you can pop, drop, or apply any stash entry, not just the most recent one. n creates a new stash from the current working tree.

Custom Commands

lazygit supports user-defined custom commands that you can trigger from any panel. Add them to ~/.config/lazygit/config.yml:

customCommands:
  - key: "C"
    command: "git commit -m '{{index .PromptResponses 0}}'"
    context: "files"
    prompts:
      - type: "input"
        title: "Commit message"
  - key: "P"
    command: "git push --force-with-lease"
    context: "localBranches"
    loadingText: "Force pushing..."

This is how you integrate one-off operations (conventional commits, specific push flags, project-specific scripts) without leaving the lazygit interface.

Limitations Worth Knowing

lazygit doesn’t replace git for everything. Complex rebase conflict resolution still drops you into your configured merge tool. Submodule handling exists but is basic. Anything requiring a git filter-repo or complex history rewriting is better done at the command line where you have full control and can read the documentation.

For day-to-day work — commits, branches, staging, rebasing, cherry-picks — it’s one of those tools where you install it, use it for a few days, and then it’s just how you use git.