jesseduffield / lazygit
Get started
Taken from the repository's own files on 23 Oct 2026. RepoPilot has not run these commands.
Prerequisites
Go 1.26.0from go.mod
Commands
Makefile| Task | Run | What it runs |
|---|---|---|
| run | make run | ./lazygit |
| build | make build | go build -gcflags='all=-N -l' |
| test | make test | runs unit-test integration-test-all |
| lint | make lint | ./scripts/gofumpt-check.sh && ./scripts/golangci-lint-shim.sh run |
| install | make install | go install |
Install and use
README.mdCall 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