A terminal git workflow with lazygit and delta
Install lazygit and delta, set delta as git's pager, render lazygit diffs with it, and stage hunks, commit and rebase from the keyboard.
Updated
in short
Set delta as git's pager in ~/.gitconfig, add it as a diff renderer in lazygit's config.yml, then do daily work in lazygit: Space to stage, Enter to stage single hunks, c to commit and the Commits panel to squash, reword and reorder.
delta reformats git's diff output with syntax highlighting, word-level changes and line numbers. lazygit is a terminal UI for git that shows files, branches and commits in panels and runs git commands behind single keys.
The two connect cleanly: delta handles git diff, git log -p and git add -p on the command line, and lazygit pipes its own diff view through delta. This guide sets up both, then covers the keys for staging, committing and rebasing.
Tools used
Before you start
- git installed; git 2.35 or newer for the
zdiff3conflict style below - A package manager such as Homebrew, pacman, dnf, winget or Scoop
- A terminal with 256-color or true-color support for delta's syntax themes
Steps
Step 1: Install lazygit and delta
delta's package is usually called
git-delta, but the command it installs isdelta. On Debian 12 and Ubuntu 25.04 or older,apthas no lazygit package; download the release tarball from the lazygit GitHub releases page instead, and use the.debfrom delta's releases page.sh# macOS or Linux with Homebrew brew install lazygit git-delta # Arch Linux sudo pacman -S lazygit git-deltash# Windows winget install -e --id=JesseDuffield.lazygit winget install dandavison.deltashlazygit --version delta --versionStep 2: Make delta git's pager
These settings come from delta's README.
core.pagersendsgit diff,git showandgit log -pthrough delta.interactive.diffFiltercolors the hunks ingit add -p.navigatelets you jump between files withnandN. Setdelta.light trueinstead ofdarkon a light terminal theme, or leave both out to let delta detect it.shgit config --global core.pager delta git config --global interactive.diffFilter 'delta --color-only' git config --global delta.navigate true git config --global delta.dark true git config --global merge.conflictStyle zdiff3gitconfig# Resulting ~/.gitconfig [core] pager = delta [interactive] diffFilter = delta --color-only [delta] navigate = true dark = true [merge] conflictStyle = zdiff3Step 3: Check delta on the command line
Run a diff in any repository with uncommitted changes. You should see file headers in boxes and highlighted code. For a two-column view, add
side-by-side = trueunder[delta], or try it once with--side-by-side.shgit diffshgit diff | delta --side-by-sideStep 4: Render lazygit's diffs with delta
lazygit shows diffs in its own main panel, so it needs to be told about delta separately. Find the config directory with
lazygit --print-config-dirand editconfig.ymlthere; on Linux that is~/.config/lazygit/config.yml. You can also pressein the Status panel to open it.Keep
--paging=neveras in lazygit's docs, so delta prints the diff instead of starting its own pager; lazygit handles scrolling. Use--lightinstead of--darkon a light theme. delta'snavigateoption does not work inside lazygit.lazygit 0.64 and newer use
diffRenderers. Versions 0.56 to 0.63 usepagerswith apager:key, and older releases usepaging:. Newer releases migrate the old keys automatically.shlazygit --print-config-diryaml# config.yml, lazygit 0.64+ git: diffRenderers: - command: delta --dark --paging=neveryaml# config.yml, lazygit 0.56 to 0.63 git: pagers: - pager: delta --dark --paging=neveryaml# config.yml, lazygit 0.55 and older git: paging: colorArg: always pager: delta --dark --paging=neverStep 5: Stage files and single hunks
Run
lazygitinside a repository. The number keys1to5jump to the Status, Files, Branches, Commits and Stash panels.In the Files panel,
Spacestages or unstages the selected file andastages everything. PressEnteron a file to open the staging view. There,Spacestages the selected hunk,aswitches between selecting whole hunks and single lines,vstarts a range selection, andTabswitches between the unstaged and staged sides.Escgoes back to the file list.shcd ~/code/my-repo lazygitStep 6: Commit, amend and push
With changes staged, press
cin the Files panel, type the summary and pressEnter.Copens your git editor instead.Aamends the last commit with what is staged.Ppushes the current branch andppulls; if there is no upstream yet, lazygit asks for one.Step 7: Rebase from the Commits panel
Press
4for the Commits panel. On any commit,rrewords the message,ssquashes it into the commit below,fdoes a fixup (squash and drop the message),ddrops it, andCtrl-jorCtrl-kmoves it down or up. lazygit runs the interactive rebase for you.To change the contents of an older commit, select it and press
e; lazygit stops the rebase there. Make your changes, stage them, pressAin the Files panel to amend that commit, then pressmand choose continue. The samemmenu aborts or skips. To rebase your branch onto another, select the target in the Branches panel and pressr.If a step goes wrong,
zundoes the last git action using the reflog andZredoes it. Undo covers commits and branches, not uncommitted working-tree changes.
Troubleshooting
delta: command not foundafter installinggit-delta: the binary isdelta. Check that your package manager's bin directory is onPATH.- lazygit diffs are still plain: the config key does not match your version. Check
lazygit --versionand usediffRenderers,pagersorpagingas shown in step 4. - Diff panel looks wrong after adding delta: check the command includes
--paging=never, and remove any--navigateorside-by-sideflags to rule them out. - Colors look wrong on a light theme: replace
--darkwith--lightin lazygit and setdelta.light truein~/.gitconfig. git add -pshows raw escape codes:interactive.diffFiltermust bedelta --color-only, not plaindelta.zdiff3is rejected: your git is older than 2.35. Usemerge.conflictStyle diff3instead.
Tips
- Press
?in any lazygit panel to list the keys available there. - You can list several entries under
diffRenderersand cycle through them with|, for example delta with and without--side-by-side. {and}shrink or grow the diff context in lazygit.
Also worth a look
- gituiAnother keyboard-driven git TUI with staging and commit panels.
- tigText-mode git browser focused on reading history and blame.
- difftasticStructural diff tool; lazygit runs it as an `extDiff` renderer.
FAQ
- Does lazygit use delta automatically if git's core.pager is set?
- Not by default. lazygit renders its own diff panel and only pipes it through a renderer listed in its config.yml, so add delta there as well as in ~/.gitconfig.
- Why does n/N navigation not work inside lazygit?
- delta's navigate option relies on its own pager, which lazygit replaces. Use lazygit's scrolling keys, or run git diff outside lazygit to use n and N.
- Can I undo a squash or drop in lazygit?
- Yes. Press z right after the action; lazygit reads the reflog to restore the previous commit state. It does not restore uncommitted file changes.