What Is Lazygit?
Lazygit is a terminal UI for Git written in Go. It gives you a visual interface for common Git operations without leaving the command line. No more memorizing every flag for git log or git diff. You see your branches, commits, and files in panels. Press keys to act on them.
I used git on the command line for years. I know the standard commands by heart. Lazygit changed the way I work. Instead of typing git add -p and checking each hunk manually, I stage files interactively with a few keystrokes. It saves minutes every day. The real win is how it cuts context switching. You stay focused on what changed instead of jumping between terminal and a GUI tool.
Installing Lazygit
Most package managers include lazygit now. On Debian or Ubuntu, you can install it directly:
sudo apt install lazygit
On Arch Linux:
sudo pacman -S lazygit
On macOS with Homebrew:
brew install lazygit
If your distro does not have it in the repos, grab the binary from the GitHub releases page. It is a single static binary with no dependencies. Drop it in your PATH and you are ready. On Fedora or RHEL, you can use the COPR repository instead:
sudo dnf copr enable atim/lazygit -y
sudo dnf install lazygit
10 Lazygit Features Worth Knowing
1. Interactive Staging
This is the feature I use most. Run lazygit inside a repository. You see your changed files in one panel. Press space to stage a file, or enter to see individual hunks. Stage only part of a file by pressing space on the hunk. It replaces git add -p with a much clearer workflow. You see exactly what you are staging.
2. Branch Switching and Management
Press the branch panel key, default is number 2. You see all local branches listed. Use arrow keys to navigate. Press enter to check out a branch. Press m to merge the selected branch into your current one. This is faster than typing git checkout or git switch every time.
3. Commit History at a Glance
The commit panel shows your full history. Each commit shows the hash, author, date, and message. Press enter on a commit to diff it against its parent. Press space to check out that commit. Press c to copy a commit hash to your clipboard. No more git log –oneline and manual copy-paste.
4. Interactive Rebase
Rebasing interactively is one of git’s most useful features, but the command line interface is clunky. You have to open an editor, reorder lines, change pick to squash or edit, save, and close. One mistake and you are in a confusing state. Lazygit makes it visual. Press e on a commit to start an interactive rebase from that point. Reorder commits with j and k. Squash with s. Edit with e. Drop with d. You see the commit list update in real time. Git still runs the rebase under the hood, but you control it from the UI.
5. Stash Management
Press s to stash your changes. The stash panel shows all stashes. Press enter to see what is in a stash. Apply it with space. Drop it with d. You can even create a branch from a stash. This beats remembering git stash list and git stash apply stash@{0}.
6. Diff Viewing
Lazygit shows diffs inline with syntax highlighting. Navigate through changes with arrow keys. Press tab to toggle between staged and unstaged changes. The diff panel supports searching with /. This is all built in without any external pager.
7. Cherry-Picking
Navigate to a commit in another branch. Press c to copy it. Switch to your target branch. Press Shift+C to paste. Lazygit handles git cherry-pick under the hood. You can pick multiple commits and they queue up.
8. Custom Commands
You can configure custom keybindings in ~/.config/lazygit/config.yml. The config format uses YAML. You define a key combination, a description, and a shell command to run. I have a custom command that opens a PR on GitHub for the current branch. Another one runs tests on the staged changes before I commit. You can pipe output back into lazygit panels too. This extends lazygit to match your specific workflow without leaving the TUI.
9. Mouse Support
If you use lazygit in a terminal that supports mouse events, you can click on panels and buttons. It works in Kitty, Alacritty, iTerm2, and most modern terminals. Mouse support makes lazygit approachable for people who are less comfortable with keyboard navigation.
10. File Tree View
Instead of a flat list of changed files, lazygit shows your working directory as a tree. Folders expand and collapse. This matters when you have changes spread across a large project. You see the structure clearly instead of scrolling through a flat list.
Lazygit and Other Terminal Tools
Lazygit works well with other terminal tools I cover on this site. I use it alongside fzf for fuzzy-finding branches. The ripgrep integration helps me find files to stage. And bat powers the syntax highlighting in lazygit’s diff view on some setups.
Getting Started
Open a terminal, cd to any git repository, and type lazygit. The interface has four panels: status, files, branches, and commits. Use the number keys 1 through 5 to switch between panels. Press ? to see all keybindings. The built-in help is good enough that you rarely need outside documentation.
The official Lazygit GitHub repository has detailed documentation and configuration examples. The docs directory covers keybindings, custom commands, and integration with editors. And the official Git documentation is always worth reading for the fundamentals.
Why Lazygit Works
Git is powerful but its command line interface has a learning curve. Lazygit does not replace git. It wraps it in an interface that maps to how you actually think about version control. Want to see what changed? Look at the diff panel. Want to undo something? Find it in the reflog panel. Want to try something risky? Create a branch and experiment with visual safety.
If you spend more than a few minutes a day using git, lazygit pays for itself in a week. Install it, run it, and see if it clicks for you.