lazygit

jesseduffieldMIT活跃维护

在终端里用键盘快捷操作完成提交、分支、rebase、cherry-pick 等 Git 日常操作,不用记命令,适合喜欢命令行但嫌 Git 命令繁琐的开发者。

simple terminal UI for git commands

v0.66.3发布于 2026-11-07 23:26 UTC83,778star +81 / 7 天3,252fork同步于 2026-11-10 05:17 UTC

怎么上手

从 README 代码块原样提取,可能是其中一种安装方式
brew install lazygit
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_${LAZYGIT_ARCH}.tar.gz"
conda install -c conda-forge lazygit
硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本v0.66.3
  1. v0.66.3最新正式版2026-11-07 · 2026-11-07 23:26 UTC

    What's Changed

    Fixes 🔧

    Full Changelog: https://github.com/jesseduffield/lazygit/compare/v0.66.2...v0.66.3

  2. v0.66.22026-10-16 · 2026-10-16 09:33 UTC
    查看更新说明

    What's Changed

    Enhancements 🔥

    Fixes 🔧

    Maintenance ⚙️

    Performance Improvements 📊

    Full Changelog: https://github.com/jesseduffield/lazygit/compare/v0.66.1...v0.66.2

  3. v0.66.12026-10-11 · 2026-10-11 09:26 UTC
    查看更新说明

    A few bug fixes for regressions introduced with the last release, and also some for older bugs.

    One visible change is that the narrow selection bar in the focused diff view is now shown on both sides of the view rather than just on the left. This should improve usability for users with very large monitors, especially when using a side-by-side diff renderer.

    For the changes of the last big release, see v0.66.0.

    The changes in detail

    Enhancements 🔥

    Fixes 🔧

    Full Changelog: https://github.com/jesseduffield/lazygit/compare/v0.66.0...v0.66.1

  4. v0.66.02026-10-05 · 2026-10-05 17:17 UTC
    查看更新说明

    This is by far the biggest release since I took over maintainership from Jesse, and some of the changes deserve a bit more explanation than usual.

    • Staging hunks is now done directly from the main view.

      There used to be a separate staging panel that you had to enter if you wanted to stage individual diff hunks; it was limited to one file at a time, and showed the raw git diff rather than the configured diff renderer. This is gone; the main view now has a selection when you focus it, and you can act on the selected hunk or line directly there:

      • press space to stage a hunk or range of lines
      • navigate to the next/previous hunk with <right>/<left>, or the next/previous file with n/N
      • press e to jump to the editor on the selected line
      • press d to discard a hunk.

      Many other enhancements were added to this new interactive diff view:

      • alt-click a line to jump to that line in the diff view (this works even when a popup panel is showing above it, e.g. the commit message editor)
      • press <ctrl-g> to see a menu with all the files in the diff, to quickly jump to one of them
      • the files in the diffstat below the commit message are clickable hyperlinks that take you to the clicked file in the diff, like the <ctrl-g> menu does
      • when changing the diff context using {/}, or when toggling the "ignore whitespace" option (<ctrl-w), the scroll position is preserved

      If you use a custom diff renderer, all of this works with the renderer's output, as long as it supports the new OSC protocol that was introduced for this. Delta and Diff-so-fancy already do, so if you use one of these, be sure to update them to the latest version. There is support for difftastic too, but it hasn't been accepted upstream, so you'll have to build it yourself from this PR. If you use any other diff renderer, please file an issue so that we can add support for it.

    • Better support for stacked branches.

      • You can now push or force-push all branches of a stack at once, simply by pushing the topmost one. Lazygit will ask you if you want to push the others as well.
      • Same for pulling: if a branch stack was rebased by someone else, you can pull the topmost branch and lazygit will ask you if you want to pull the other branches in the stack too, without checking them out.
      • Branches of a stack are now listed in order in the branches panel. When rebasing a stack it is common for all branch tips to get the same committer date, in which case git sorts them alphabetically, which is confusing. We now have extra logic to preserve the stack order in this case.
      • Unrelated to stacks (but common to show up in that case): when a branch diverges from its upstream (you see ↓3↑5) it was impossible to tell whether that was because you rebased or rewrote the branch, in which case you want to force push, or because someone else rebased the branch, in which case you want to pull it. Lazygit can now distinguish these cases, and will show the ↓3↑5 in a dimmer yellow in the latter case. What's more, in this latter case you can "pull" the branch without checking it out by pressing f, like you already could for branches showing ↓7.
    • Dark and light themes.

      Lazygit now determines whether your terminal has a dark or light background, and can use different color themes for each; it can also switch between the two dynamically if your terminal does. You can also pass this information on to your diff renderer if you use one that needs it, by using the new {{colorScheme}} template variable in the renderer command.

    • Better rendering of the commit graph.

      Since the commit graph uses box drawing characters it could only be an approximation; some graph topologies ca

  5. v0.65.12026-09-13 · 2026-09-13 05:46 UTC
    查看更新说明

    What's Changed

    Fixes 🔧

    Maintenance ⚙️

    Full Changelog: https://github.com/jesseduffield/lazygit/compare/v0.65.0...v0.65.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    A simple terminal UI for git commands

    GitHub Releases golangci-lint GitHub tag homebrew

    Sponsors

    Elevator Pitch

    Rant time: You've heard it before, git is powerful, but what good is that power when everything is so damn hard to do? Interactive rebasing requires you to edit a goddamn TODO file in your editor? Are you kidding me? To stage part of a file you need to use a command line program to step through each hunk and if a hunk can't be split down any further but contains code you don't want to stage, you have to edit an arcane patch file by hand? Are you KIDDING me?! Sometimes you get asked to stash your changes when switching branches only to realise that after you switch and unstash that there weren't even any conflicts and it would have been fine to just checkout the branch directly? YOU HAVE GOT TO BE KIDDING ME!

    If you're a mere mortal like me and you're tired of hearing how powerful git is when in your daily life it's a powerful pain in your ass, lazygit might be for you.

    Table of contents

    Lazygit is not my fulltime job but it is a hefty part time job so if you want to support the project please consider sponsoring me

    Features

    Stage hunks or individual lines

    Press 0 on a changed file to focus its diff in the main view. The selection covers a whole hunk to begin with, so <space> stages that hunk and moves on to the next one. When you want only part of a hunk, press a for line-by-line selection and v to select a range of lines. What you staged shows up in the pane below. Press <tab> to move between the two panes; <space> unstages in the lower one. Press c to commit without leaving the diff.

    Interactive Rebase

    Press i to start an interactive rebase. Then squash (s), fixup (f), drop (d), edit (e), move up (ctrl+k) or move down (ctrl+j) any of the TODO commits, before continuing the rebase by bringing up the rebase options menu with m and then selecting continue.

    You can also perform any of these actions as a once-off (e.g. pressing s on a commit to squash it) without explicitly starting a rebase.

    This demo also uses shift+down to select a range of commits to move and fixup.

    Cherry-pick

    Press shift+c on a commit to copy it and press shift+v to paste (cherry-pick) it.

    Bisect

    Press b in the commits view to mark a commit as good/bad in order to begin a git bisect.

    Nuke the working tree

    For when you really want to just get rid of anything that shows up when you run git status (and yes that includes dirty submodules) kidpix style, press shift+d to bring up the reset options menu and then select the 'nuke' option.

    Amend an old commit

    Pressing shift+a on any commit will amend that commit with the currently staged changes (running an interactive rebase in the background).

    Filter

    You can filter a view with /. Here we filter down our branches view and then hit enter to view its commits.

    Invoke a custom command

    Lazygit has a very flexible custom command system. In this example a custom command is defined which emulates the built-in branch checkout action.

    Worktrees

    You can create worktrees to have multiple branches going at once without the need for stashing or creating WIP commits when switching between them. Press w in the branches view to create a worktree from the selected branch and switch to it.

    Rebase magic (custom patches)

    You can build a custom patch from an old commit and then remove the patch from the commit, split out a new commit, apply the patch in reverse to the index, and more.

    In this example an old commit contains a change that belongs in a commit of its own. We hit 0 on the commit to focus its diff. <space> on the hunk we want to move adds it to the custom patch, and ctrl+p opens the custom patch options, where we choose to move the patch into a new commit.

    Learn more in the Rebase magic Youtube tutorial.

    If you only want to remove a hunk from an old commit, you don't need a custom patch for that. Select the hunk in the commit's diff and press d. Lazygit rewrites the commit without it, running an interactive rebase in the background.

    Rebase from marked base commit

    Say you're on a feature branch that was itself branched off of the develop branch, and you've decided you'd rather be branching off the master branch. You need a way to rebase only the commits from your feature branch. In this demo we check to see which was the last commit on the develop branch, then press shift+b to mark that commit as our base commit, then press r on the master branch to rebase onto it, only bringing across the commits from our feature branch. Then we push our changes with shift+p.

    Undo

    You can undo the last action by pressing z and redo with shift+z. Here we drop a couple of commits and then undo the actions. Undo uses the reflog which is specific to commits and branches so we can't undo changes to the working tree or stash.

    More info

    Commit graph

    When viewing the commit graph in an enlarged window (use + and _ to cycle screen modes), the commit graph is shown. Colours correspond to the commit authors, and as you navigate down the graph, the parent commits of the selected commit are highlighted.

    Compare two commits

    If you press shift+w on a commit (or branch/ref) a menu will open that allows you to mark that commit so that any other commit you select will be diffed against it. Once you've selected the second commit, you'll see the diff in the main view and if you press <enter> you'll see the files of the diff. You can press shift+w to view the diff menu again to see options like reversing the diff direction or exiting diff mode. You can also exit diff mode by pressing <escape>.

    Show GitHub pull requests

    In the branches panel, lazygit can show which of your branches have an associated GitHub pull request by showing a GitHub icon next to the branch name; its color shows the state of the PR (open, merged, etc.). For those that have one, you can press shift-G to open the PR in the browser. There is no configuration needed to enable this for github.com, but it requires the gh tool to be installed, and you need to do gh auth login once to allow lazygit to access GitHub. For GitHub Enterprise, also run gh auth login --hostname <webDomain> and add a services entry for the host with the github provider.

    Tutorials

    Installation

    Packaging status

    Most of the above packages are maintained by third parties so be sure to vet them yourself and confirm that the maintainer is a trustworthy looking person who attends local sports games and gives back to their communities with barbeque fundraisers etc

    Binary Releases

    For Windows, Mac OS(10.12+) or Linux, you can download a binary release here.

    Dev container feature

    If you want to use lazygit in e.g. one of your GitHub Codespaces, there is a third-party dev container feature based on the binary releases mentioned above.

    Homebrew

    It works with Linux, too.

    brew install lazygit
    

    MacPorts

    Latest version built from github releases. Tap:

    sudo port install lazygit
    

    Void Linux

    Packages for Void Linux are available in the distro repo

    They follow upstream latest releases

    sudo xbps-install -S lazygit
    

    Scoop (Windows)

    You can install lazygit using scoop. It's in the extras bucket:

    # Add the extras bucket
    scoop bucket add extras
    
    # Install lazygit
    scoop install lazygit
    

    gah (Linux and Mac OS)

    You can install lazygit using gah:

    gah install lazygit
    

    Arch Linux

    Packages for Arch Linux are available via pacman and AUR (Arch User Repository).

    There are two packages. The stable one which is built with the latest release and the git version which builds from the most recent commit.

    Instruction of how to install AUR content can be found here: https://wiki.archlinux.org/index.php/Arch_User_Repository

    Fedora / Amazon Linux 2023 / CentOS Stream

    Packages for Fedora, Amazon Linux 2023 and CentOS Stream are available via Copr (Cool Other Package Repo).

    sudo dnf copr enable dejan/lazygit
    sudo dnf install lazygit
    

    These packages are built using the RPM spec file located here: https://codeberg.org/dejan/rpm-lazygit

    You should be able to build RPMs for Fedora 41 or older, and other Fedora derivatives using the SRPM (Source RPM) file that you can grab from the latest COPR build.

    Fedora / RHEL Derivatives (Terra)

    Packages for Fedora and RHEL derivatives are also available from the Terra Repository.

    sudo dnf install --nogpgcheck --repofrompath 'terra,https://repos.fyralabs.com/terra$releasever' terra-release
    sudo dnf install lazygit
    

    (Install guide for Atomic/EL can be found on their README)

    Terra also has lazygit-doc, which contains the contents of the docs folder.

    Solus Linux

    sudo eopkg install lazygit
    

    Debian and Ubuntu

    For Debian 13 "Trixie", Sid, and later, or Ubuntu 25.10 "Questing Quokka" and later:

    sudo apt install lazygit
    

    For Debian 12 "Bookworm", Ubuntu 25.04 "Plucky Puffin" and earlier:

    LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | \grep -Po '"tag_name": *"v\K[^"]*')
    LAZYGIT_ARCH=$(uname -m | sed -e 's/aarch64/arm64/')
    curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_${LAZYGIT_ARCH}.tar.gz"
    tar xf lazygit.tar.gz lazygit
    sudo install lazygit -D -t /usr/local/bin/
    

    Verify the correct installation of lazygit:

    lazygit --version
    

    Funtoo Linux

    Funtoo Linux has an autogenerated lazygit package in dev-kit:

    sudo emerge dev-vcs/lazygit
    

    Gentoo Linux

    Lazygit is not (yet) in main Gentoo portage, however an ebuild is available in GURU overlay

    You can either add the overlay to your system and install lazygit as usual:

    sudo eselect repository enable guru
    sudo emaint sync -r guru
    sudo emerge dev-vcs/lazygit
    

    openSUSE

    The lazygit package is currently built in devel:languages:go/lazygit.

    To install lazygit on openSUSE Tumbleweed run:

    sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Factory/devel:languages:go.repo
    sudo zypper ref && sudo zypper in lazygit
    

    To install lazygit on openSUSE Leap run:

    source /etc/os-release
    sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/go/$VERSION_ID/devel:languages:go.repo
    sudo zypper ref && sudo zypper in lazygit
    

    NixOS

    Using lazygit from nixpkgs

    On NixOS, lazygit is packaged with nix and distributed via nixpkgs. You can try lazygit without installing it with:

    nix-shell -p lazygit
    # or with flakes enabled
    nix run nixpkgs#lazygit
    

    Or you can add lazygit to your configuration.nix using the environment.systemPackages option. More details can be found via NixOS search page.

    Using the official lazygit flake

    This repository includes a nix flake that provides the latest development version and additional development tools:

    Run lazygit directly from the repository:

    nix run github:jesseduffield/lazygit
    # or from a local clone
    nix run .
    

    Build lazygit from source:

    nix build github:jesseduffield/lazygit
    # or from a local clone
    nix build .
    

    Development environment: For contributors, the flake provides a development shell with Go toolchain, development tools, and dependencies:

    nix develop github:jesseduffield/lazygit
    # or from a local clone
    nix develop
    

    The development shell includes:

    • Go toolchain
    • git and make
    • Proper environment variables for development

    Using in other flakes: The flake also provides an overlay for easy integration into other flake-based projects:

    {
      inputs.lazygit.url = "github:jesseduffield/lazygit";
    
      outputs = { self, nixpkgs, lazygit }: {
        # Use the overlay
        nixpkgs.overlays = [ lazygit.overlays.default ];
      };
    }
    

    Flox

    Lazygit can be installed into a Flox environment as follows.

    flox install lazygit
    

    More details about Flox can be found on their website.

    FreeBSD

    pkg install lazygit
    

    Termux

    apt install lazygit
    

    Conda

    Released versions are available for different platforms, see https://anaconda.org/conda-forge/lazygit

    conda install -c conda-forge lazygit
    

    Go

    go install github.com/jesseduffield/lazygit@latest
    

    Please note: If you get an error claiming that lazygit cannot be found or is not defined, you may need to add ~/go/bin to your $PATH (macOS/Linux), or %HOME%\go\bin (Windows). Not to be mistaken for C:\Go\bin (which is for Go's own binaries, not apps like lazygit).

    Chocolatey (Windows)

    You can install lazygit using Chocolatey:

    choco install lazygit
    

    Winget (Windows 10 1709 or later)

    You can install lazygit using the winget command in the Windows Terminal with the following command:

    winget install -e --id=JesseDuffield.lazygit
    

    Manual

    You'll need to install Go

    git clone https://github.com/jesseduffield/lazygit.git
    cd lazygit
    go install
    

    You can also use go run main.go to compile and run in one go (pun definitely intended)

    Usage

    Call lazygit in your terminal inside a git repository.

    $ lazygit
    

    If you want, you can also add an alias for this with echo "alias lg='lazygit'" >> ~/.zshrc (or whichever rc file you're using).

    Keybindings

    You can check out the list of keybindings here.

    Changing Directory On Exit

    If you change repos in lazygit and want your shell to change directory into that repo on exiting lazygit, add this to your ~/.zshrc (or other rc file):

    lg()
    {
        export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
    
        lazygit "$@"
    
        if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
                cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
                rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
        fi
    }
    

    Then source ~/.zshrc and from now on when you call lg and exit you'll switch directories to whatever you were in inside lazygit. To override this behaviour you can exit using shift+Q rather than just q.

    Undo/Redo

    See the docs

    Configuration

    Check out the configuration docs.

    Custom Diff Renderers

    See the docs

    Custom Commands

    If lazygit is missing a feature, there's a good chance you can implement it yourself with a custom command!

    See the docs

    Git flow support

    Lazygit supports Gitflow (or git-flow-next) if you have it installed. To understand how the Gitflow model works check out Vincent Driessen's original post explaining it. To view Gitflow options from within Lazygit, press i from within the branches view.

    Contributing

    We love your input! Please check out the contributing guide. For contributor discussion about things not better discussed here in the repo, join the discord channel

    Check out this video walking through the creation of a small feature in lazygit if you want an idea of where to get started.

    Debugging Locally

    Run lazygit --debug in one terminal tab and lazygit --logs in another to view the program and its log output side by side

    Donate

    If you would like to support the development of lazygit, consider sponsoring me (github is matching all donations dollar-for-dollar for 12 months)

    FAQ

    What do the commit colors represent?

    • Green: the commit is included in the master branch
    • Yellow: the commit is not included in the master branch
    • Red: the commit has not been pushed to the upstream branch

    Shameless Plug

    If you want to see what I (Jesse) am up to in terms of development, follow me on twitter or check out my blog

    Alternatives

    If you find that lazygit doesn't quite satisfy your requirements, these may be a better fit: