ScriptsApr 11, 2026·2 min read

Lazygit — Simple Terminal UI for Git Commands

Lazygit is a simple terminal UI for git commands. Stage files, commit, push, rebase, cherry-pick, squash, and browse history without memorizing 30 git commands. Written in Go and designed for speed with vim-style keybindings.

TL;DR
Lazygit replaces 30+ git CLI commands with an intuitive terminal UI and vim-style keybindings.
§01

What it is

Lazygit is a terminal user interface for git written in Go by Jesse Duffield. It replaces the dozens of git command-line verbs with panels for files, branches, commits, stashes, and remotes. Built on gocui with vim-like navigation, it makes staging, rebasing, cherry-picking, and conflict resolution visual and fast.

The tool is for developers who live in the terminal and want a faster alternative to git add, git commit, and git rebase sequences.

§02

How it saves time or tokens

Interactive rebasing in raw git requires memorizing flags like --onto, --continue, and --abort. Lazygit turns these into single-key actions. Visual conflict resolution shows both sides inline, eliminating the need to open a separate merge tool. Typical git workflows that take 5-10 commands compress into 2-3 keystrokes.

§03

How to use

  1. Install via your package manager: brew install lazygit (macOS), sudo apt install lazygit (Debian/Ubuntu), or go install github.com/jesseduffield/lazygit@latest.
  2. Navigate to any git repository in your terminal.
  3. Run lazygit to launch the TUI.
§04

Example

# Install lazygit
brew install lazygit

# Launch in your project
cd ~/my-project
lazygit

# Essential keybindings inside lazygit:
# space  - stage/unstage file
# c      - commit
# P      - push
# p      - pull
# b      - branches panel
# r      - rebase onto
# m      - merge
# z      - undo
# ?      - help menu
§05

Related on TokRepo

§06

Common pitfalls

  • Lazygit uses your global git config. If you have custom merge tools or diff settings, they apply inside the TUI as well.
  • The z (undo) feature uses git reflog under the hood. It cannot undo operations that git reflog does not track, such as dropping stashes.
  • On first launch, the default layout may feel cramped on small terminals. Resize your terminal to at least 120x40 for a comfortable experience.

Frequently Asked Questions

Is lazygit a replacement for the git CLI?+

Lazygit covers the most common git operations visually. For scripting, automation, or advanced plumbing commands, you still need the git CLI. Most developers use both: lazygit for interactive work and git CLI for scripts.

Does lazygit support custom keybindings?+

Yes. Lazygit reads a config file at ~/.config/lazygit/config.yml where you can remap keys, change themes, and configure custom commands that run arbitrary shell scripts.

Can lazygit handle large repositories?+

Yes. Lazygit is written in Go and handles large repos efficiently. It lazy-loads commit history and diffs, so startup time stays fast even in repositories with thousands of commits.

Does lazygit work with GitHub and GitLab?+

Lazygit works with any git remote. It pushes, pulls, and fetches using your configured remotes. It does not have built-in GitHub/GitLab PR creation, but you can add custom commands to invoke gh or glab CLI tools.

How do I resolve merge conflicts in lazygit?+

Navigate to the conflicted file in the files panel, press enter to open the conflict view, then use arrow keys and enter to pick the side you want. Lazygit highlights both sides inline and lets you accept left, right, or both.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets