RepoPilot

jesseduffield / lazygit

Search jesseduffield/lazygit

GitHub

Get started

Taken from the repository's own files on 23 Oct 2026. RepoPilot has not run these commands.

Prerequisites

Commands

Makefile
TaskRunWhat it runs
runmake run./lazygit
buildmake buildgo build -gcflags='all=-N -l'
testmake testruns unit-test integration-test-all
lintmake lint./scripts/gofumpt-check.sh && ./scripts/golangci-lint-shim.sh run
installmake installgo install

Install and use

README.md

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

Open README.md