Skip to main content

Reference · Reference

Lazygit Keybindings & Commands

Search lazygit keybindings by panel with one-click copy. A complete cheat sheet covering files, branches, commits, stash, line-by-line staging, CLI flags, and config.yml setup.

Last updated:

Supported version: v0.65.x (latest v0.65.0 / September 2026) | Updated September 2026

How to Use

Expand how to use
  1. 1

    Filter by category or search

    Use the panel category buttons (Files / Branches / Commits, etc.) or the search box to find the keybinding you need.

  2. 2

    Check the keybinding

    Review the key and its description. Lazygit assigns different actions to the same key depending on the focused panel, so pay attention to the category.

  3. 3

    Copy commands to use them

    Copy CLI flags and config.yml examples to your clipboard and paste them straight into your terminal or config file.

Supported Version

This cheat sheet covers lazygit v0.65.x (latest v0.65.0, released September 5, 2026), including panel keybindings, CLI flags, and config.yml settings.

v0.65.0 (September 5, 2026)

  • No keybinding, CLI flag, or config.yml changes — all 144 entries on this page were re-verified against the v0.65.0 docs (Keybindings_en.md / entry_point.go / Config.md)
  • The keybindings and recent repos menus can now be filtered simply by typing, without a prefix key
  • The Worktrees pane can filter worktrees by branch name

v0.64.0 (August 2026)

  • Renamed config.yml's git.pagers array to git.diffRenderers, unifying delta-style external renderers and raw git diffs under a type field (stdinFilter / extDiff / rawGit)
  • Shows GitHub PR checks (CI) status in the branches panel
  • Added mouse drag support for range selection and commit reordering
View version details

Global & Navigation

?
Open the keybindings menu showing every key available in the current panel.
q
Quit lazygit. ctrl+c also works.
esc
Cancel and return to the previous view or panel.
P
Push the current branch to its upstream. Prompts you to configure an upstream if none is set.
p
Pull changes from the remote for the current branch.
R
Refresh the git state (runs git status, git branch, etc. in the background). Does not run git fetch.
m
View options to abort/continue/skip the current merge or rebase.
z
Undo the last git command using the reflog (commits only; working tree changes are not affected).
Z
Redo the undone git command using the reflog.
:
Bring up a prompt where you can execute any shell command.
ctrlr
Switch to a recently opened repository.
+
Switch to the next screen mode (normal/half/fullscreen). Press _ for the previous mode.
ctrls
View options for filtering the commit log so only matching commits are shown.
W
View options for diffing two refs (ctrl+e also works).
ctrlw
Toggle whether whitespace changes are shown in the diff view.
@
View options for the command log (show/hide and focus).
pgup
Scroll up the main window (also K or ctrl+u).
pgdown
Scroll down the main window (also J or ctrl+d).
h/l
Move between side panels (left/right arrow keys also work).
j/k
Move up/down within a list (arrow keys also work).
[/]
Switch to the previous/next tab within a panel.
</>
Scroll to the top/bottom of a list (home / end also work).
/
Search or filter the current view by text.
v
Toggle range select mode (shift+up / shift+down also work).
0
Focus the main view.
ctrlo
Copy the selected item (file path, commit hash, branch name, etc.) to the clipboard.
altshiftc
Open config.yml directly in your external editor. This global keybinding was added in v0.63.

Files

space
Toggle staged state for the selected file.
a
Toggle staged/unstaged for all files in the working tree.
c
Commit staged changes. Opens the commit message panel.
w
Commit changes without running the pre-commit hook.
C
Commit changes using the git editor.
A
Amend the last commit with staged changes (git commit --amend).
ctrlf
Find the base commit that your current changes build upon, for amending or fixing up.
d
View options for discarding changes to the selected file.
D
View reset options for the working tree (e.g. nuking the working tree).
e
Open the selected file in your external editor.
o
Open the selected file in its default application.
i
Add the selected file to .gitignore or exclude.
r
Refresh the files list.
s
Stash all changes. Use S for other stashing variations.
S
View stash options (stash all, stash staged, stash unstaged).
enter
If a file is selected, open the staging view for individual hunks/lines. If a directory is selected, collapse/expand it.
f
Fetch changes from the remote.
M
View options for resolving merge conflicts.
`
Toggle the file view between flat and tree layout.
ctrlb
Filter files by status (staged / unstaged, etc.).

Branches & Tags

space
Checkout the selected branch.
n
Create a new branch off the selected branch.
N
Create a new branch and move the unpushed commits of the current branch to it. Useful if you forgot to create a branch first.
c
Checkout by name. Enter '-' to switch to the previous branch.
-
Checkout the previously checked-out branch.
F
Force checkout the selected branch, discarding all local changes first.
d
View delete options for the local/remote branch.
r
Rebase the checked-out branch onto the selected branch.
M
View options for merging the selected branch into the current branch (regular or squash merge).
f
Fast-forward the selected branch from its upstream.
R
Rename the selected branch.
u
View options for the branch's upstream (set, unset, reset).
g
View reset options (soft/mixed/hard) for resetting onto the selected branch.
s
Change the sort order of branches.
T
Create a new tag.
o
Create a pull request for the selected branch.
O
View create pull request options.
G
Open the pull request in the browser (requires gh CLI login, since v0.61).
ctrly
Copy the pull request URL to the clipboard.
i
Show git-flow options.
enter
View the commits of the selected branch.
n
Add a new remote (in the Remotes tab).
d
View delete options for the local/remote tag (in the Tags tab).
P
Push the selected tag to a remote (in the Tags tab).
w
Create a new worktree directly from the selected branch. Since v0.63 this happens instantly instead of opening a confirmation menu.

Commits

s
Squash the selected commit into the commit below it. The messages are combined.
f
Fixup: meld the selected commit into the commit below it, discarding its message.
r
Reword the selected commit's message.
R
Reword the commit message using the git editor.
d
Drop the selected commit (removes it from the branch via rebase).
e
Edit: start an interactive rebase from the selected commit.
i
Start an interactive rebase for the commits on your branch.
p
Mark the selected commit to be picked (when mid-rebase).
F
Create a 'fixup!' commit for the selected commit. Press S later to apply all fixups.
S
Squash all 'fixup!' commits above the selected commit or in the branch (autosquash).
c
Set the message option for the fixup commit.
ctrlj
Move the selected commit down one (alt+down also works).
ctrlk
Move the selected commit up one (alt+up also works).
C
Mark the commit as copied for cherry-picking. Press V in the local commits view to paste.
V
Paste (cherry-pick) the copied commits into your checked-out branch.
ctrlr
Reset the cherry-picked (copied) commits selection.
A
Amend the selected commit with staged changes. Non-HEAD commits are amended via rebase.
a
Set/reset the commit author or add a co-author.
t
Create a revert commit that reverses the selected commit's changes.
T
Create a new tag pointing at the selected commit.
B
Mark the commit as the base for the next rebase (uses git rebase --onto).
space
Checkout the selected commit as a detached HEAD.
y
Copy a commit attribute (hash, URL, diff, message, author) to the clipboard.
o
Open the commit in the browser.
n
Create a new branch off the selected commit.
g
View reset options (soft/mixed/hard) for resetting onto the selected commit.
w
Create a new worktree directly from the selected commit. Since v0.63 this happens instantly instead of opening a confirmation menu.

Stash

space
Apply the stash entry to your working directory (keeps the entry).
g
Pop: apply the stash entry and remove it from the list.
d
Drop the stash entry from the stash list.
n
Create a new branch from the selected stash entry.
r
Rename the stash entry.
enter
View the files in the stash entry.
w
Create a new worktree directly from the selected stash entry. Since v0.63 this happens instantly instead of opening a confirmation menu.

Staging (Line-by-line)

space
Toggle the selected line/hunk between staged and unstaged.
a
Toggle between line-by-line and hunk selection mode.
d
Discard the selected unstaged change, or unstage the selected staged change.
v
Toggle range select to stage multiple lines at once.
left/h
Go to the previous hunk.
right/l
Go to the next hunk.
tab
Switch between the staged and unstaged changes views.
E
Edit the selected hunk in your external editor.
c
Commit staged changes.
esc
Return to the files panel.
space
Pick the selected hunk when resolving merge conflicts.
b
Pick both hunks (yours and theirs) when resolving merge conflicts.
z
Undo the last merge conflict resolution.
d
Remove the selected lines from the commit (in the custom patch builder).

CLI Options

lazygit

Launch lazygit in the git repository of the current directory.

Notes

  • Run inside a git repository
  • Running outside a repo prompts you to initialize one

Examples

cd ~/projects/myapp && lazygit
Move into a repo and open the TUI

lazygit status

Launch with focus on a specific panel. Accepts status / branch / log / stash.

Notes

  • lazygit status … status panel
  • lazygit branch … branches panel
  • lazygit log … commit log
  • lazygit stash … stash panel

Examples

lazygit branch
Open focused on the branches panel
lazygit log
Open focused on the commit log

-p, --path

Launch lazygit for the git repository at the given path.

Notes

  • Equivalent to --work-tree=<path> --git-dir=<path>/.git/

Examples

lazygit --path ~/projects/myapp
Open the specified repository

-f, --filter

Launch in filter mode, showing history for the given path only (like running git log with a path filter).

Notes

  • Commits, reflog and stash are filtered by the path
  • Some operations are restricted in filter mode

Examples

lazygit --filter src/main.go
Show the change history of a single file

-w, --work-tree

Equivalent of git's --work-tree argument. Useful for bare-repo dotfiles management.

Notes

  • Often combined with --git-dir
  • Can also be set via the GIT_WORK_TREE env var

Examples

lazygit --work-tree ~ --git-dir ~/.dotfiles
Manage dotfiles with a bare repository

-g, --git-dir

Equivalent of git's --git-dir argument. Explicitly sets the .git directory location.

Notes

  • Can also be set via the GIT_DIR env var

Examples

lazygit --git-dir ~/repos/myapp/.git
Launch with an explicit .git directory

-sm, --screen-mode

Set the initial screen mode (size of the focused panel).

Notes

  • normal (default) / half / full

Examples

lazygit --screen-mode full
Launch in fullscreen mode

-v, --version

Print the current version.

Examples

lazygit --version
Show version, commit, build date and OS

-c, --config

Print the default config. A handy starting point for customization.

Examples

lazygit --config
Output the default config as YAML

-cd, --print-config-dir

Print the config directory (where config.yml lives).

Notes

  • macOS: ~/Library/Application Support/lazygit
  • Linux: ~/.config/lazygit
  • Windows: %LOCALAPPDATA%\lazygit

Examples

lazygit --print-config-dir
Find where config.yml is located

-ucd, --use-config-dir

Override the default config directory with the provided directory.

Examples

lazygit --use-config-dir ~/.config/lazygit-work
Launch with a work-specific config directory

-ucf, --use-config-file

Use custom config file(s). Comma-separated; later files take precedence.

Examples

lazygit --use-config-file ~/base.yml,~/overrides.yml
Merge multiple config files

-d, --debug

Run in debug mode with logging. View the logs with --logs in another terminal.

Notes

  • Set the LOG_LEVEL env var to change the log level (debug/info/warn/error)

Examples

lazygit --debug
Launch in debug mode

-l, --logs

Tail lazygit logs. Use while lazygit --debug is running in another terminal tab.

Examples

lazygit --logs
Watch logs in a separate terminal

Config & Customization

config.yml

Lazygit's config file. The location depends on your OS; check it with lazygit --print-config-dir.

Notes

  • macOS: ~/Library/Application Support/lazygit/config.yml
  • Linux: ~/.config/lazygit/config.yml
  • Windows: %LOCALAPPDATA%\lazygit\config.yml

Examples

lazygit --print-config-dir
Find the config directory

gui.language

Set the UI language.

Notes

  • auto (default, follows your OS language)
  • en / ja / ko / zh-CN / ru / pl / nl, etc.

Examples

gui:
  language: 'en'
Force the UI to English

gui.theme

Customize colors such as panel borders and the selected line background.

Notes

  • activeBorderColor / inactiveBorderColor
  • selectedLineBgColor / optionsTextColor, etc.

Examples

gui:
  theme:
    activeBorderColor:
      - green
      - bold
Make the active panel border green and bold

keybinding

Remap any keybinding. Since v0.62 you can use rich combos like ctrl+alt+shift and assign multiple keys.

Notes

  • universal: keys shared across panels
  • files / branches / commits, etc.: per-panel keys
  • Use <disabled> to disable a key

Examples

keybinding:
  universal:
    quit: 'Q'
    return: '<backspace>'
Change the quit and cancel keys

customCommands

Bind your own git or shell commands to keys, with optional prompts and menus.

Notes

  • key: the key to bind
  • command: the command to run (Go templates supported)
  • context: the panel where it applies (files / localBranches / commits, etc.)
  • prompts: input prompts or selection menus

Examples

customCommands:
  - key: 'C'
    command: 'git cz'
    context: 'files'
    output: terminal
Launch commitizen with the C key

git.diffRenderers

Configure an external diff renderer, e.g. delta or diff-so-fancy for syntax highlighting (renamed from git.pagers in v0.64).

Notes

  • Set colorArg: always (for type: stdinFilter)
  • command: delta / diff-so-fancy / ydiff, etc.

Examples

git:
  diffRenderers:
    - name: delta
      colorArg: always
      command: delta --dark --paging=never
Syntax-highlighted diffs with delta

gui.nerdFontsVersion

Set your Nerd Fonts version to show icons next to files and branches.

Notes

  • "2" or "3" (quotes required)
  • Default is empty (no icons)

Examples

gui:
  nerdFontsVersion: "3"
Show Nerd Fonts v3 icons

os.editPreset

Choose which editor opens when you press e on a file.

Notes

  • vscode / vim / nvim / emacs / sublime / kakoune / helix / xcode, etc.
  • If unset, guessed from $(git config core.editor) or $EDITOR

Examples

os:
  editPreset: 'vscode'
Open files in VS Code with the e key

alias lg='lazygit'

Add a shell alias so you can launch lazygit by typing lg.

Examples

echo "alias lg='lazygit'" >> ~/.zshrc && source ~/.zshrc
Add the lg alias to zsh

LAZYGIT_NEW_DIR_FILE

Make your shell cd into the repo you switched to inside lazygit when you exit.

Notes

  • Define it as a shell function
  • Exit with shift+Q to skip changing directory

Examples

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
}
cd into the last opened repo on exit

Version Info

Compiled from official lazygit GitHub releases.

v0.65.0 (September 5, 2026)

View official release

  • No keybinding, CLI flag, or config.yml changes — all 144 entries on this page were re-verified against the v0.65.0 docs (Keybindings_en.md / entry_point.go / Config.md)
  • The keybindings and recent repos menus can now be filtered simply by typing, without a prefix key
  • The Worktrees pane can filter worktrees by branch name
  • Keeps the resolved file selected after a conflict resolution, and auto-selects the conflicted commit when a rebase stops
  • Draws the UI in a more inactive look while the window is not focused
v0.64.0 (August 2026)

View official release

  • Renamed config.yml's git.pagers array to git.diffRenderers, unifying delta-style external renderers and raw git diffs under a type field (stdinFilter / extDiff / rawGit)
  • Shows GitHub PR checks (CI) status in the branches panel
  • Added mouse drag support for range selection and commit reordering
  • Major concurrency model overhaul that eliminates data races
  • Added a {{diffContext}} template variable for external diff commands
v0.63.1 (July 2026)

View official release

  • Bugfix release (2026-07-15) fixing regressions from v0.63.0 — no keybinding, CLI flag, or config.yml changes. Every entry on this page was re-verified against the v0.63.1 docs
  • Improved the index.lock retry mechanism and fixed a Windows deadlock when switching between longer diffs
v0.63.0 (July 2026)

View official release

  • Simplified worktree creation: pressing w in the branches, commits, stash, and other panels now creates a new worktree directly from the selected item instead of opening a confirmation menu
  • Added a global alt+shift+c keybinding to open config.yml directly in your external editor
  • Added a reverse pager cycling key (\)
  • Added direnv support
  • Detects external repo changes via background polling
v0.62.0 – v0.62.2 (May–June 2026)

View official release

  • Major keybinding revamp: supports rich combinations like ctrl+alt+shift+x
  • New keybinding syntax <ctrl+a> introduced (old <c-a> still supported)
  • Breaking change: commit confirmation changed from alt+enter to cmd+enter (Mac) / ctrl+enter (Linux/Windows)
  • Multiple keys can now be assigned to a single action
  • GitHub Enterprise support for the pull request feature
v0.61.0 (April 2026)

View official release

  • GitHub pull request integration: PR icons next to branches, press G to open in browser
  • Enable it just by logging in with the gh CLI (gh auth login)
  • File sort order and case sensitivity are now configurable
  • Click arrows in the file list to expand/collapse directories
v0.60.0 (March 2026)

View official release

  • Added d to remove lines directly in the custom patch builder
  • File views now filter rather than search
  • Show worktree names next to branches and in the worktrees tab
  • Backward log cycling with A on the status page

About Lazygit Keybindings & Commands

Lazygit is a terminal UI (TUI) Git client written in Go. It lets you stage, commit, branch, rebase interactively, and cherry-pick — all with keyboard shortcuts instead of typing git commands. With more than 60,000 GitHub stars it has become one of the most popular Git tools, but because every panel (Files / Branches / Commits / Stash) has its own keybindings, it takes time to learn what each key does where. This cheat sheet organizes the main keybindings of lazygit v0.65.x by panel, fully searchable with one-click copy. It covers the basics you need right after installing (space to stage, c to commit, P to push), advanced operations like interactive rebase, cherry-picking and line-by-line staging, CLI launch flags, and config.yml customization (key remapping, delta integration, custom commands). You can always press ? inside lazygit for help, but this tool is handy when you want a cross-panel overview or want to copy ready-made config examples.

Key Features

  • Keybindings organized by panel (Global / Files / Branches / Commits / Stash / Staging)
  • Full-text search across keys and descriptions, plus category filters
  • CLI launch flags (--filter, --path, --screen-mode, etc.) with examples
  • config.yml customization examples (key remapping, delta integration, custom commands)
  • One-click copy for every command and config snippet
  • Covers lazygit v0.65 with a version history section

Use Cases

  • You just installed lazygit and want to learn the basics
  • You forgot the keys for interactive rebase or cherry-picking
  • You want to see how the same key behaves differently per panel
  • You want to copy delta or Nerd Fonts integration settings
  • You manage your lazygit config in dotfiles and need a reference

Frequently Asked Questions

What is lazygit?

Lazygit is a terminal-based Git client (TUI) written in Go. It lets you run git add / commit / push / rebase and more using only keyboard shortcuts. It has earned more than 60,000 stars on GitHub.

How do I install lazygit?

On macOS run 'brew install lazygit'. On Windows use 'scoop install lazygit' or 'winget install -e --id=JesseDuffield.lazygit'. Most Linux distributions have it in their package manager, and with Go installed you can run 'go install github.com/jesseduffield/lazygit@latest'.

How do I see keybindings inside lazygit?

Press ? inside lazygit to open a menu of keybindings available in the focused panel. Use this cheat sheet when you want a cross-panel overview or full-text search.

Why does the same key do different things?

Lazygit assigns key meanings per focused panel. For example, d discards changes in the Files panel, drops a commit in the Commits panel, and deletes a stash entry in the Stash panel. This cheat sheet groups keys by panel so you can compare them.

Can I customize the keybindings?

Yes. Remap any key in the keybinding section of config.yml. Since v0.62, rich combinations like ctrl+alt+shift+x and multiple keys per action are supported. See the Config & Customization category for examples.

Can I change the UI language?

Yes. Set gui.language in config.yml (e.g. 'ja', 'en', 'zh-CN'). The default 'auto' follows your OS language setting.

How do I get syntax-highlighted diffs?

Configure an external diff renderer such as delta or diff-so-fancy under git.diffRenderers (renamed from git.pagers in v0.64). The Config & Customization category includes a ready-to-copy delta example.

Which lazygit version does this cheat sheet cover?

It covers lazygit v0.65.x (latest v0.65.0, released September 5, 2026). Keybindings are sourced from the official repository docs (Keybindings_en.md) and source code.

Is there a complete lazygit keybindings cheatsheet?

Yes — this page is a complete lazygit cheatsheet that lists every keybinding by panel (Global, Files, Branches, Commits, Stash, Staging), along with CLI launch flags and config.yml options. Use the category filter or full-text search to find any key instantly, or press ? inside lazygit to see the keybindings for the panel you are currently in.

What command-line flags does lazygit support?

Lazygit supports launch flags such as --path (open the repository at a given path), --filter (show history for a single file or path), --screen-mode (start with the focused panel at normal, half, or full size), --work-tree and --git-dir (bare-repo dotfiles setups), --use-config-file (load a custom config), and --debug with --logs (troubleshooting). The CLI Options category on this page lists every launch flag with copyable examples.

Can I create custom commands in lazygit?

Yes. The customCommands section of config.yml lets you bind your own git or shell commands to any key, with optional prompts and menus for arguments. The Config & Customization category on this page includes a copyable customCommands example, alongside key remapping and delta pager integration snippets.

How do I create and manage git worktrees in lazygit?

Press w on a branch, commit, or stash entry to create a new worktree directly from the selected item (simplified in v0.63). In the Worktrees view, n creates a new worktree, space switches to the selected one, o opens it in your editor, and d removes the worktree together with its metadata.