Global 30
| Action | Shortcut |
|---|---|
| Switch to recent repoOpens the list of recently opened repositories; inside the Commits panel the key clears the cherry-pick selection instead. | Ctrl+R |
| Scroll main window upWorks while a side panel has focus, so a long diff can be read from the list. | Page UporKorCtrl+U |
| Scroll main window down | Page DownorJorCtrl+D |
| View command log optionsOffers showing or hiding the command log and moving focus to it. | @ |
| PushThe branch you are on goes to its upstream; with none configured, lazygit asks for one. | P |
| PullUpdates the current branch from its remote; inside the Commits panel the key marks a commit as picked during a rebase. | p |
| Increase rename similarity thresholdA deleted and an added file must be more alike to count as a rename; git.renameSimilarityThreshold holds the default. | ) |
| Decrease rename similarity thresholdLooser matching: less similar pairs of deleted and added files are shown as renames. | ( |
| Increase diff context sizeShows more unchanged lines around each change; git.diffContextSize holds the default. | } |
| Decrease diff context sizeShows fewer unchanged lines around each change. | { |
| Execute shell commandOpens a prompt; the command you type runs without leaving lazygit. | : |
| View merge and rebase optionsAbort, continue or skip the merge or rebase that is in progress. | m |
| RefreshReloads status and branches in the background; nothing is fetched from the remote. | R |
| Next screen modeCycles the focused panel through normal, half and fullscreen sizes. | + |
| Previous screen modeSteps back through the same three sizes. | _ |
| Cycle diff renderersSwitches to the following entry among the diff renderers set up in your config. | | |
| Cycle diff renderers in reverseGoes to the previous entry of that list instead. | \ |
| Jump to file within diffLists the files of the diff being shown and scrolls to the chosen one; focus does not move. | Ctrl+G |
| Open external diff toolRuns git difftool on the selection inside the file, branch, commit and tag panels. | Ctrl+T |
| CancelAlso closes menus, prompts and confirmation panels. | Esc |
| Open keybindings menu | ? |
| View filter optionsLimits the commit log to matching commits, for example those touching one file path. | Ctrl+S |
| View diffing optionsDiff against the selected ref, type a ref to compare with, or reverse the direction. | WorCtrl+E |
| Quit | qorCtrl+C |
| Quit without changing directorySkips the directory switch performed by the lg shell function described in the README. | Q |
| Suspend lazygit | Ctrl+Z |
| Toggle whitespaceHides or shows whitespace-only changes in diffs; git.ignoreWhitespaceInDiffView holds the default. | Ctrl+W |
| Edit config fileOpens lazygit's config file with the external editor; the Status panel offers it on e. | Alt+Shift+C |
| UndoReverses the last git command by way of the reflog; working-tree changes are not restored. | z |
| RedoReapplies the command that was just undone, again via the reflog. | Z |
Status panel 5
| Action | Shortcut |
|---|---|
| Edit config file | e |
| Check for update | u |
| Switch to recent repo | Enter |
| Show all branch logsRepeated presses cycle through the all-branches log views. | a |
| Show all branch logs in reverseCycles through those log views in the opposite order. | A |
Files 25
| Action | Shortcut |
|---|---|
| Stage or unstage fileWith a diff focused, the key instead stages only the selected hunk or lines. | Space |
| Stage allSwitches every file of the working tree between staged and unstaged at once. | a |
| Focus file diff or collapse directoryOn a file, moves into its diff to work on single hunks or lines; a directory folds or unfolds. | Enter |
| Discard changesOpens the choices for throwing away changes to the selected file. | d |
| Reset working treeOpens reset choices for the whole working tree, up to nuking every change. | D |
| CommitOpens the commit message panel for whatever is staged. | c |
| Commit without pre-commit hook | w |
| Commit using git editorHands the message over to the editor git is configured with. | C |
| Amend last commit | A |
| Find fixup base commitLocates the commit your current changes build on, sparing a manual scan of the branch. | Ctrl+F |
| Edit fileUses the external editor; the diff and merge-conflict views have this key too. | e |
| Open fileUses the default application, like a double-click in the file manager. | o |
| Ignore or exclude file | i |
| Refresh files | r |
| StashStashes all changes; the stash options key covers the other variants. | s |
| View stash optionsChoose between stashing everything, only staged or only unstaged changes. | S |
| View upstream reset options | g |
| Toggle file tree viewSwitches between one flat list of paths and a tree grouped by directory; gui.showFileTree holds the default. | ` |
| Collapse all filesFolds every directory of the file tree; the Commit files panel has it too. | - |
| Expand all filesUnfolds every directory of the file tree. | = |
| View merge conflict optionsOpens the choices for resolving conflicted files. | M |
| Fetch | f |
| Filter files by statusNarrows the list to staged or to unstaged files. | Ctrl+B |
| Copy path to clipboardCopies the path of the selected file; the Commit files panel has this key too. | Ctrl+O |
| Copy file info to clipboard | y |
Staging and diff view 14
The staged pane below (Secondary) has the same keys, and from either pane c, w, C and Ctrl + F commit exactly as they do in the Files panel.
| Action | Shortcut |
|---|---|
| Switch diff paneMoves between the unstaged pane and the staged pane shown below it. | Tab |
| Toggle hunk selectionSwitches between selecting whole hunks and selecting line by line. | a |
| Stage or unstage selectionApplies to the selected hunk, line or range only. | Space |
| Discard or unstage selectionAn unstaged change is thrown away with git reset; a staged one merely goes back to unstaged. | d |
| Edit hunkOpens only the selected hunk with the external editor. | E |
| Copy selected diff lines | Ctrl+O |
| Go to previous hunk | Leftorh |
| Go to next hunk | Rightorl |
| Go to previous file | N |
| Go to next file | n |
| Open pull request at lineOpens the branch's GitHub pull request at the selected line, ready for a comment. | G |
| Exit to side panel | Esc |
| Scroll diff with mouse wheel | Scroll |
| Open clicked line in editorFocus and selection stay put, so it works while reading a diff from another panel. | Alt+ClickorShift+Click |
Merge conflicts 8
| Action | Shortcut |
|---|---|
| Pick hunkKeeps the highlighted side of the conflict. | Space |
| Pick both hunksKeeps both sides of the conflict. | b |
| Previous hunk | Upork |
| Next hunk | Downorj |
| Previous conflict | Leftorh |
| Next conflict | Rightorl |
| Undo conflict resolutionTakes back the last hunk pick made here. | z |
| Return to files panel | Esc |
Branches 21
| Action | Shortcut |
|---|---|
| Check out branch | Space |
| Checkout by nameType a branch name; entering - switches to the previous branch. | c |
| Checkout previous branch | - |
| Force checkoutThrows away every local change of the working directory, then switches to the selected branch. | F |
| New branch | n |
| Move commits onto new branchTakes the current branch's unpushed commits, whatever is selected; meant for work started on the wrong branch. | N |
| Rename branch | R |
| Delete branchOpens the delete choices for the local or the remote branch. | d |
| Rebase onto selected branchIt is the checked-out branch that gets rebased, not the selected one. | r |
| Merge into current branchOffers a regular merge or a squash merge of the selected branch. | M |
| Fast-forwardBrings the selected branch up to date with its upstream branch. | f |
| View upstream optionsSet or unset the upstream of the branch, or reset the branch to it. | u |
| New tag | T |
| Sort order | s |
| Show git-flow optionsNeeds Gitflow or git-flow-next to be installed. | i |
| Create pull request | o |
| Pull request creation options | O |
| Open pull request in the browserThe Commits panel has this key as well. | G |
| Copy pull request URL | Ctrl+Y |
| Copy branch name | Ctrl+O |
| View commitsLists the commits of the selected branch; remote branches, tags and reflog entries open likewise. | Enter |
Remotes and remote branches 9
Remote branches also take the Branches keys for new branch, merge, rebase, sort order and viewing commits.
| Action | Shortcut |
|---|---|
| View remote branches | Enter |
| New remote | n |
| Remove remoteLocal branches that track branches of this remote are left alone. | d |
| Edit remoteChanges the name or the URL of the selected remote. | e |
| Fetch remoteDownloads what is new on that remote; nothing gets merged into local branches. | f |
| Add fork remoteBuilds the fork's address from origin with another owner and can check out one of its branches. | F |
| Check out remote branchCreates a local branch based on it, or checks it out as a detached head. | Space |
| Delete remote branchRemoves the branch on the remote itself. | d |
| Set as upstreamThe branch you have checked out will track the selected remote branch. | u |
Tags 5
| Action | Shortcut |
|---|---|
| Check out tagLeaves the repository on a detached HEAD at that tag. | Space |
| New tagTags the current commit; a prompt asks for the name and an optional description. | n |
| Delete tagOpens the delete choices for the local or the remote tag. | d |
| Push tagAsks which remote should receive the selected tag. | P |
| Copy tag name | Ctrl+O |
Commits 34
The Reflog and Sub-commits panels take the Commits keys for checkout, copying a hash or attribute, opening in the browser, new branch, reset, cherry-pick copy and selecting the commits of the current branch.
| Action | Shortcut |
|---|---|
| Check out commitLeaves you on a detached HEAD; reflog entries and sub-commits behave alike. | Space |
| View commit filesLists the files the commit changed; stash entries and sub-commits open likewise. | Enter |
| SquashFolds the selected commit into the one below and appends its message there. | s |
| FixupLike squash, except that the folded commit's message is thrown away. | f |
| Set fixup messageChooses which message the fixup keeps, such as this commit's rather than the target's. | c |
| RewordEdits the message of the selected commit. | r |
| Reword with editor | R |
| DropRemoves the commit through a rebase; later commits that depend on it may conflict. | d |
| Edit commitStarts an interactive rebase at this commit; mid-rebase it marks the commit so the rebase pauses there. | e |
| Start interactive rebaseCovers the branch from HEAD down to the first merge or main-branch commit. | i |
| PickDuring a rebase, marks the commit to be kept once the rebase continues. | p |
| Move commit down | Ctrl+JorAlt+Down |
| Move commit up | Ctrl+KorAlt+Up |
| Create fixup commitThe new fixup! commit targets the selection and is squashed in later with S. | F |
| Apply fixup commitsAutosquash: melds every fixup! commit over the selection, or of the whole branch, into its target. | S |
| Amend selected commitAdds what is staged: git commit --amend on HEAD, a background rebase for an older commit. | A |
| Amend commit attributeOpens a menu for resetting or setting the author and adding a co-author. | a |
| Reset commit author | athena |
| Set commit author | athenA |
| Add co-author | athenc |
| RevertCreates a new commit that undoes what the selected one changed. | t |
| Copy commit for cherry-pickMarks the commit as copied; paste with V and clear the marks with Esc. | C |
| Paste commitsCherry-picks the commits copied with C onto the checked-out branch. | V |
| Reset cherry-pick selectionClears the marks on commits that were copied. | Ctrl+R |
| Mark base commit for rebaseOnly commits above the mark are carried over by the next rebase onto another branch. | B |
| Tag commitPrompts for a tag name and an optional description. | T |
| New branch from commit | n |
| View reset optionsSoft, mixed or hard reset onto the selected item; branches, tags and reflog entries offer it too. | g |
| View bisect optionsMark the selected commit good or bad to begin a git bisect. | b |
| View log optionsChange the sort order, hide the git graph or show the whole graph. | Ctrl+L |
| Select current branch's commits | * |
| Copy commit attributeOffers the hash, URL, diff, message or author for copying. | y |
| Open commit in browser | o |
| Copy abbreviated commit hash | Ctrl+O |
Commit files and custom patches 5
| Action | Shortcut |
|---|---|
| Check out file from commitReplaces the working-tree file with the one stored by the selected commit. | c |
| Remove file changes from commitRewrites the commit through a background rebase, which can conflict with later commits touching the file. | d |
| Toggle file in custom patchAdds the file to the custom patch or takes it out again. | Space |
| Toggle all files in patchAdds or removes every file of the commit in one step. | a |
| View custom patch optionsGlobal key; use it once files or hunks of a commit are in the patch. | Ctrl+P |
Stash 5
| Action | Shortcut |
|---|---|
| Apply stash entryApplies it to the working directory; the entry stays on the stash list. | Space |
| Pop stash entryApplies it and then deletes it from the stash list. | g |
| Drop stash entry | d |
| New branch from stash entryBranches at the commit the stash was made on and applies the stash there as a commit. | n |
| Rename stash | r |
Submodules 8
| Action | Shortcut |
|---|---|
| Enter submoduleOpens the submodule as a repository; Esc goes back to the parent repo. | Enter |
| New submodule | n |
| Initialize submodulePrepares it for fetching; run the update key afterwards to get its contents. | i |
| Update submodule | u |
| Update submodule URL | e |
| Remove submoduleDeletes the submodule together with its directory. | d |
| View bulk submodule options | b |
| Copy submodule name | Ctrl+O |
Worktrees 5
| Action | Shortcut |
|---|---|
| New worktree | n |
| Create worktree from selectionOffered on branches, commits, reflog entries, stash entries and tags; from a branch it also switches to the worktree. | w |
| Switch to worktree | Space |
| Open worktree in editor | o |
| Remove worktreeDeletes its directory and the metadata git keeps about it under .git. | d |
Command-line options 14
| Action | Shortcut |
|---|---|
| Open repository at pathStands for passing both --work-tree and --git-dir for that repository. | -p / --path |
| Filter commits by pathOnly commits, reflog entries and stashes touching the path are listed, as with lazygit -f my/path. | -f / --filter |
| Open with a panel focusedThe argument may be status, branch, log or stash; a filter path overrides it. | lazygit status |
| Set initial screen modeTakes normal (the default), half or full, which sets how large the focused panel is. | -sm / --screen-mode |
| Set work treePassed on as git's own work-tree argument. | -w / --work-tree |
| Set git directoryPassed on as git's own git-dir argument. | -g / --git-dir |
| Use custom config filesTakes a comma-separated list; the LG_CONFIG_FILE variable does the same. | -ucf / --use-config-file |
| Use another config directory | -ucd / --use-config-dir |
| Print config directory | -cd / --print-config-dir |
| Print default config | -c / --config |
| Print version | -v / --version |
| Run in debug modeLogs while running; the LOG_LEVEL variable picks debug, info, warn or error. | -d / --debug |
| Tail lazygit logsMeant for a second terminal tab while a debug-mode lazygit runs in the first. | -l / --logs |
| Show command-line help | --help |
No row on this page matches that filter.
Notes
The commit loop
In the Files panel, Space stages or unstages the highlighted file and a toggles every file at once; Enter focuses the file's diff so individual hunks can be staged with the same Space key, and a there switches to line-by-line selection. c commits with a message typed in lazygit, C opens your git editor for a longer one, and A amends the last commit. p pulls and P pushes; both are global keys, although the Tags panel uses P to push the selected tag. d opens the discard options for a file, and s stashes all changes.
Rewriting history without typing rebase commands
In the Commits panel, Ctrl + J and Ctrl + K move a commit down or up, which is an interactive rebase without the todo file. F creates a fixup commit for the highlighted commit and S squashes the fixup commits in; from the Files panel, Ctrl + F finds the commit your current changes build on. t reverts, T tags, g opens the reset options for the commit, and N moves the branch's unpushed commits to a new branch, whatever is selected. z undoes the last git command by reading the reflog, which is the safety net for all of the above, though it does not bring back changes to the working tree.
Seeing what happened
v starts a range selection so several files or commits can be acted on at once. W opens diffing options to compare two refs, Ctrl + W hides whitespace changes, and } and { widen or narrow the diff context. @ opens the command log options, where the log of git commands lazygit has run on your behalf can be shown, hidden or focused; it is the fastest way to learn what a key actually does under the hood. + cycles the screen modes normal, half and fullscreen to give the focused panel more room.
Questions
How do I stage part of a file?
Press Enter on the file to focus its diff. The selection starts as a whole hunk, so Space stages that hunk; press a first for line-by-line selection, or v to select a range of lines.
Can I undo a rebase or reset I did in lazygit?
Press z. Lazygit reads the reflog to work out which git command reverses the last one; Z redoes. Only commits are covered, not changes to the working tree.
How do I see the git commands lazygit is running?
Press @ to open the command log options and view the log panel.
Why does the same key do different things?
Keys are scoped to the focused panel. Press ? in any panel for its bindings, or Tab to move to the next side panel.
Which lazygit keys are different on macOS?
Only a few text-input defaults: moving the cursor by word and deleting a word use Alt on macOS and Ctrl on Linux and Windows. Lazygit picks the set from the system it runs on, and the LAZYGIT_KEYBINDING_PLATFORM environment variable overrides that choice.
Sources and checks
- Lazygit keybindings (docs/keybindings/Keybindings_en.md, release v0.66.0) Default keys of every panel, as generated from the lazygit source for this release
- Lazygit user config reference (docs/Config.md, release v0.66.0) Default keybinding block: item and panel navigation, search matches, text-input and commit-message keys, macOS differences
- Lazygit source: command-line flags (pkg/app/entry_point.go, release v0.66.0) Flags and help texts that lazygit --help prints
- Lazygit documentation: Searching/Filtering (docs/Searching.md, release v0.66.0) Which views search and which filter
- Lazygit README (release v0.66.0) Staging walkthrough, changing directory on exit, debugging flags
Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.
Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.