Lazygit – Terminal UI for Git Commands

4.9 Stars
Version 0.44.0
15 MB

Simplify Git Workflows with Lazygit Terminal Interface

Lazygit brings the power of Git to your terminal through an intuitive, keyboard-driven interface that makes complex Git operations feel effortless. For developers who prefer staying in the terminal but find raw Git commands tedious for common operations, Lazygit provides the perfect middle ground between command-line efficiency and graphical user interface convenience.

Written in Go, Lazygit renders a full terminal user interface (TUI) that displays your repository status, branches, commits, stash, and files in organized panels. Navigation happens through simple keyboard shortcuts, allowing you to stage files, create commits, manage branches, resolve conflicts, and perform interactive rebases without memorizing complex Git commands or leaving your terminal.

Installation

Linux Installation

Ubuntu/Debian:

LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
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

Arch Linux:

sudo pacman -S lazygit

Fedora (via COPR):

sudo dnf copr enable atim/lazygit -y
sudo dnf install lazygit

macOS Installation

brew install lazygit

Windows Installation

choco install lazygit
# or
scoop install lazygit
# or
winget install -e --id=JesseDuffield.lazygit

Basic Navigation

Launching Lazygit

Simply run in any Git repository:

lazygit

Or with alias in your shell config:

alias lg='lazygit'

Panel Navigation

The interface consists of several panels:
Status: Repository status and recent branches
Files: Changed files (staged/unstaged)
Branches: Local and remote branches
Commits: Commit history
Stash: Stashed changes

Navigate between panels:

Tab / Shift+Tab  - Move between panels
h / l            - Previous/next panel
j / k            - Move up/down within panel
Enter            - Select/expand item
Escape           - Cancel/go back
q                - Quit lazygit

File Operations

Staging Files

In the Files panel:

Space     - Stage/unstage file
a         - Stage all files
Shift+a   - Unstage all files
d         - Discard changes (with confirmation)

Partial Staging

Stage individual hunks or lines:

Enter     - View file diff
Space     - Stage/unstage hunk
v         - Select range of lines
Space     - Stage selected lines

Viewing Changes

Enter     - View file diff
Ctrl+o    - Copy file path
e         - Open file in editor

Commit Operations

Creating Commits

c         - Commit staged changes (opens commit message editor)
Shift+c   - Commit with editor (for longer messages)
Ctrl+o    - Copy commit SHA

Amending Commits

Shift+a   - Amend last commit
a         - Amend commit with staged changes

Interactive Rebase

In the Commits panel:

e         - Edit commit
r         - Reword commit message
f         - Fixup (squash without message)
s         - Squash commit
d         - Drop commit
Ctrl+j/k  - Move commit up/down

Start interactive rebase:

i         - Start interactive rebase from selected commit

Branch Management

Branch Operations

Space     - Checkout branch
n         - New branch
d         - Delete branch
r         - Rebase current branch onto selected
Shift+m   - Merge selected into current
Ctrl+o    - Create pull request

Viewing Branch Details

Enter     - View branch commits
/         - Filter branches

Remote Operations

Fetch, Pull, Push

f         - Fetch
p         - Pull
Shift+p   - Push
Ctrl+p    - Push with options (force, etc.)

Remote Management

Enter     - View remote branches
n         - Add new remote

Merge Conflict Resolution

Conflict Navigation

When conflicts exist:

Enter     - View conflicted file
h         - Pick left (ours)
l         - Pick right (theirs)
b         - Pick both
Space     - Pick current hunk
Escape    - Exit conflict view

Stash Operations

Managing Stash

s         - Stash changes
Space     - Apply stash
g         - Pop stash (apply and drop)
d         - Drop stash
n         - New branch from stash

Custom Commands

Configuration File

Create custom commands in ~/.config/lazygit/config.yml:

customCommands:
  - key: "C"
    context: "files"
    command: "git commit -m '{{.Form.Message}}'"
    prompts:
      - type: "input"
        title: "Commit message"
        key: "Message"
  - key: "P"
    context: "commits"
    command: "git push origin {{.SelectedLocalCommit.Name}}"
    description: "Push specific commit"

Key Bindings

Customize key bindings:

keybinding:
  universal:
    quit: 'q'
    return: ''
  files:
    stageAll: 'a'
    unstageAll: 'A'

Integration

Editor Integration

Set your preferred editor:

os:
  editCommand: 'nvim'
  editCommandTemplate: '{{editor}} {{filename}}'

Neovim Integration

Using lazy.nvim or packer:

-- lazy.nvim
{
  "kdheepak/lazygit.nvim",
  keys = {
    { "lg", "LazyGit", desc = "LazyGit" },
  },
}

Advanced Features

Cherry Picking

c         - Copy (cherry-pick) commit
v         - Paste (apply) cherry-picked commits

Bisect

b         - Start/mark bisect
Shift+b   - Reset bisect

Submodules

Navigate to submodules panel and manage them with familiar commands.

Worktrees

w         - Worktree operations (in branches panel)

Tips and Workflows

Quick Staging Workflow

1. Press 'a' to stage all
2. Press 'c' to commit
3. Write message and confirm
4. Press 'P' to push

Rebase Workflow

1. Navigate to Commits panel
2. Select commit to rebase from
3. Press 'i' for interactive rebase
4. Use 's' to squash, 'r' to reword
5. Press 'm' to continue rebase

Branch Cleanup

1. Navigate to Branches panel
2. Press '/' to filter
3. Select merged branches
4. Press 'd' to delete

Lazygit transforms Git from a tool requiring command memorization into an intuitive visual experience. The terminal-native approach means you never leave your development environment while gaining access to Git operations that would otherwise require multiple commands or a full graphical client. For developers seeking to streamline their Git workflow while staying in the terminal, Lazygit represents an essential productivity enhancement.

Developer: Jesse Duffield

Download Options

Download Lazygit – Terminal UI for Git Commands

Version 0.44.0

File Size: 15 MB

Download Now
Safe & Secure

Verified and scanned for viruses

Regular Updates

Always get the latest version

24/7 Support

Help available when you need it