Lazygit/Q/What are the main keyboard shortcuts for lazygit?
- Especially for pulling from the remote, pushing to the remote, committing, and browsing recent repos.
Answer
- Keyshort Lazygit Lazygit/Keyshort
- Commit Staged Changes Card
- Shortcut:
c - Description: Opens an inline message input for the staged changes.
C opens the commit message in $EDITOR instead, which is what a multi-line body needs.
- Reword the Last Commit Card
- Shortcut:
r in the Commits panel - Description: Edits the message of the selected commit inline;
R opens it in $EDITOR. Works on any unpushed commit, not only HEAD.
- My Note
- Keyshort Lazygit Lazygit/Keyshort
- Switch to a Recent Repository Card
- Shortcut:
<ctrl+r> - Description: Opens a list of recently visited repositories and rebinds the running lazygit session to the one chosen — no quitting,
cd, and relaunching.
- My Note
- The cross-repo counterpart to
[ / ], which cycle tabs within one repository. - Launched from LazyVim with
<leader>gg, lazygit starts at the editor's git root, so this is the way out to a different repo without leaving the session — see LazyVim/Keyshort/Git.
- Keyshort Lazygit Lazygit/Keyshort
- Open the Copy to Clipboard Modal #card
- Shortcut:
y - Description: Opens a Curses Modal with copy options.
- Copy file name to clipboard #card
- Shortcut:
y then n (via modal), or <ctrl+o> directly (no modal) - Description: Copies the file name to clipboard.
- Copy relative path to clipboard #card
- Shortcut:
y then p - Description: Copies the relative path to clipboard.
- Copy absolute path to clipboard #card
- Shortcut:
y then P - Description: Copies the absolute path to clipboard.
- Copy diff of selected files to clipboard #card
- Shortcut:
y then s - Description: Copies the diffS of selected files to clipboard. Requires a selection.
- Mnemonic: yank the selected files, yank diffs
- Copy diff of all files to clipboard #card
- Shortcut:
y then a - Description: Copies the diff of all files to clipboard.
- Mnemonic: yank all diffs