Skip to main content

lazygit

Git from the keyboard, in a text UI: stage, commit, rewrite history.

In useCLIWindowsmacOSLinux github.com

lazygit is a text UI for Git. Everything painful on the command line — staging part of a file, rewriting the last commits, resolving a conflict — is done from the keyboard while seeing what you do. It is how I do most of my git day to day.

How I use it​

I open it with the lg alias in the terminal, or with <leader>gz from Neovim. It keeps its default configuration.

KeyAction
Spacestage / unstage the file (or the line, in the detail view)
astage everything
ccommit
P / ppush / pull
e (on a commit)interactive rebase from that commit
s, r, dsquash into the previous one, reword, drop a commit
zundo the last action
?every key of the current panel

The main benefit is the preview: while going through changed files, you see each one's diff before deciding to stage it, and you can stage only some lines. Interactive rebase, which on the command line means editing a text file, becomes a series of reversible keystrokes.

Commits are signed as usual: lazygit calls Git, which goes through 1Password (see Git and GitHub).