Skip to content
AI SI Daily
中文

Search the site

↑↓ Select · Enter Open · Esc Close

○ Overview

lazygit Guide: Terminal UI Features and Getting Started

Discover lazygit, a terminal UI for Git that streamlines staging, rebasing, and branch workflows. Learn what it does and how to get started.

AI SI Daily Editors
This is an overview compiled from the official website, documentation and GitHub README. We have not tested it ourselves. Features and pricing are subject to the official pages; sources are listed at the end.

What it is

Version control systems are an essential part of contemporary software engineering, and Git stands as the most widely adopted tool in this domain. However, while Git offers extensive capabilities, interacting with its command-line interface can frequently prove complicated, repetitive, and challenging for everyday practitioners. According to the project README, lazygit is designed as a simple terminal user interface (TUI) for Git commands, created by Jesse Duffield to address these recurring frustrations.

A terminal user interface bridges the gap between conventional command-line tools and heavy graphical applications. Instead of requiring the user to switch between a terminal window and an external desktop program, a TUI operates entirely within the console. It arranges information into interactive visual panels, status displays, and selectable lists that can be manipulated using keyboard shortcuts. This setup allows developers to maintain their focus inside their preferred command-line environment while gaining the visual context and navigational convenience typically associated with desktop software.

The motivation behind lazygit, detailed in the project’s elevator pitch, stems from the friction that developers encounter during routine version control tasks. The project README describes Git as undeniably powerful, but questions the practicality of that power when common operations require tedious manual work. For example, performing an interactive rebase in standard Git traditionally requires opening an editor to modify a text-based list of commits. Similarly, staging only a portion of a file often obliges a developer to step through individual chunks of code via the command line, and if a chunk cannot be split further, the developer is forced to edit raw patch files by hand. Furthermore, developers frequently experience situations where Git demands that uncommitted changes be stashed prior to switching branches, only for the user to realize after switching and restoring the stash that no conflicting files actually existed.

Lazygit was created specifically for everyday developers who want relief from these daily operational hurdles. By presenting a coherent, panel-based view of repository status, files, branches, and commit histories, lazygit turns complex Git routines into straightforward, keyboard-driven actions directly inside the terminal.

What it can do

Lazygit packages an extensive collection of version control capabilities into its terminal interface. Rather than replacing the underlying Git engine, it provides an interactive visual layer over Git commands, allowing users to inspect repository states and execute multi-step operations efficiently.

According to the project README, lazygit includes the following core capabilities:

  • Stage hunks or individual lines: In version control terminology, a hunk represents a contiguous block of modified code. When preparing changes to be committed, developers often prefer not to stage an entire file at once. Lazygit enables users to stage specific hunks or even drill down to stage individual lines of code directly, eliminating the need to construct or edit arcane patch files manually.
  • Interactive rebase: Rebasing allows developers to reorganize, combine, or clean up their commit history. In standard command-line Git, this process involves opening an editor and modifying a text-based todo file. Lazygit streamlines interactive rebasing within the terminal interface, making history management far more accessible.
  • Cherry-pick: Cherry-picking is the act of taking an individual commit from one branch and applying it to another. Lazygit supports cherry-picking commits across branches without requiring users to memorize and execute multi-part command sequences.
  • Bisect: Git bisect uses binary search algorithms to pinpoint the exact commit that introduced a bug or defect into a codebase. Lazygit integrates bisect support, guiding users through the investigative process within its visual panels.
  • Nuke the working tree: When working on exploratory code or resolving significant issues, developers sometimes need to discard all uncommitted modifications across the repository. Lazygit includes a dedicated option to clear and reset the working tree quickly.
  • Amend an old commit: Modifying a previous commit that is several revisions back in the history usually requires a complicated rebase procedure. Lazygit provides functionality to amend older commits directly from the interface.
  • Filter: Navigating through large repositories with long histories can be overwhelming. Lazygit allows users to filter views and repository data to locate relevant commits, branches, or files rapidly.
  • Invoke a custom command: Recognizing that developers often have specialized workflows or unique toolchains, lazygit provides the ability to invoke custom commands directly from within the application.
  • Worktrees: Git worktrees allow a developer to check out and work on multiple branches simultaneously in separate directories. Lazygit includes integrated support for managing and interacting with Git worktrees.
  • Rebase magic with custom patches: For sophisticated history rewrites, lazygit features specialized rebase capabilities that leverage custom patches to streamline advanced modifications.
  • Rebase from marked base commit: When initiating a rebase, lazygit enables users to mark a specific base commit to anchor the rebase operation, offering clear control over which segment of history is being reorganized.
  • Undo: Version control mistakes can be stressful to resolve. Lazygit provides an undo function that allows users to step back from accidental actions or unwanted modifications.
  • Commit graph: Understanding the relationship between different branches and merge points is much easier when visualized. Lazygit renders an interactive commit graph directly in the console, depicting repository topology clearly.
  • Compare two commits: Inspecting differences between disparate points in history is essential for code review and auditing. Lazygit allows users to select two distinct commits and view a direct comparison of the changes between them.
  • Commit and push workflows: As illustrated in the project README’s demonstration video, lazygit facilitates a unified workflow for staging modified files, entering commit messages, and pushing updates to remote repositories.

How to get started

Getting started with lazygit involves obtaining the application through one of the many distribution channels supported by the project and learning its basic navigation. The project documentation outlines diverse installation avenues across major operating systems and development environments.

Users can acquire lazygit through the following methods referenced in the project README:

  • Binary Releases: Precompiled standalone binaries are published directly through GitHub Releases, allowing users on supported architectures to download and execute lazygit without configuring separate package repositories.
  • Dev container: For teams using containerized development workflows, lazygit is available as a development container feature, making it straightforward to embed into standardized development images.
  • Package managers for macOS and Linux: Users on macOS and Linux can install lazygit using popular package managers including Homebrew, MacPorts (on macOS), and gah (available across Linux and macOS).
  • Windows package management: On Windows systems, lazygit can be installed using the Scoop package manager.
  • Linux distributions: The project documentation lists dedicated distribution packages for Arch Linux and Void Linux, as well as Red Hat ecosystem distributions including Fedora, Amazon Linux 2023, and CentOS Stream.

To assist new users in acclimating to the interface, the project README includes dedicated tutorials. These guides demonstrate how to navigate between panels, interact with staging lists, and execute common version control workflows. Because exact command syntax and package manager invocations vary across operating systems and release versions, users should consult the official project documentation on GitHub for the specific commands matching their environment.

Pricing and requirements

Lazygit is an open-source project published under the MIT license, according to repository metadata. Pricing, sponsorship tiers, and any future plans are subject to the official lazygit page.

Project maintenance and ongoing development are sustained by community contributors and financial backers through GitHub Sponsors. The project README acknowledges several prominent sponsors, including Warp (described as an intelligent terminal available for macOS and Linux), Tuple (a screen sharing application for developers on macOS and Windows), and Subble (a platform co-founded by Jesse Duffield to identify unused and over-provisioned SaaS licenses), along with a large group of individual community sponsors.

In terms of platform and environment requirements, lazygit is designed to operate wherever a compatible terminal and Git installation exist. The project’s documented installation options indicate broad platform support across Linux distributions (such as Fedora, CentOS Stream, Amazon Linux 2023, Arch Linux, and Void Linux), macOS, and Windows. In addition, lazygit can run within containerized development environments via its dev container feature. Development and code quality badges displayed in the repository README show that the project is built with the Go programming ecosystem, monitored by Go Report Card, linted with golangci-lint, and tracked for code quality and test coverage using Codacy.

Who it is for

Lazygit is intended for developers, software engineers, and command-line users who rely on Git for daily version control but find traditional command-line interactions unnecessarily complex or cumbersome. According to the author’s elevator pitch in the project README, the tool is aimed at everyday developers who want to harness the genuine power of Git without suffering the friction of editing raw todo files during interactive rebases, manually piecing together patch files for partial staging, or managing branch-switching stashes needlessly.

It is particularly well-suited for developers who spend a significant portion of their workday inside the terminal and prefer not to interrupt their flow by switching to heavy graphical desktop clients. At the same time, it serves programmers who desire clear visual feedback, such as an interactive commit graph, side-by-side commit comparisons, and visible panel layouts showing staged and unstaged changes. Teams operating in diverse environments—ranging from local workstations on macOS, Linux, and Windows to remote or containerized setups—can also benefit from lazygit’s cross-platform accessibility and lightweight terminal architecture.

Alternatives

  • tig is a text-mode interface for Git repositories.
  • GitUI is a terminal-based user interface for managing Git.

Sources

Related