l

lazygit cheat sheet

55 shortcuts in 10 lessons

Reading a list won't make them stick. ShortcutFoo has you type each shortcut, then brings it back just before you'd forget it.

Staging & Committing I

5 shortcuts
  • SPACE
    Stage or unstage the file
  • a
    Stage all files
  • c
    Commit staged changes
  • A
    Amend the last commit
  • s
    Stash all changes

Staging & Committing II

5 shortcuts
  • d
    Discard changes to the file
  • e
    Open the file in your editor
  • f
    Fetch from the remote
  • `
    Toggle the file tree view
  • ↵
    Focus the file diff

Everywhere I

6 shortcuts
  • ?
    Open the keybindings menu
  • p
    Pull
  • P
    Push
  • z
    Undo
  • Z
    Redo
  • :
    Execute a shell command

Everywhere II

5 shortcuts
  • R
    Refresh
  • ^R
    Switch to a recent repo
  • +
    Next screen mode
  • /
    Search the current view
  • q
    Quit

Branches I

5 shortcuts
  • SPACE
    Check out the branch
  • c
    Check out by name
  • -
    Check out the previous branch
  • n
    New branch
  • d
    Delete the branch

Branches II

5 shortcuts
  • r
    Rebase onto the branch
  • M
    Merge into the current branch
  • f
    Fast-forward the branch
  • R
    Rename the branch
  • o
    Create a pull request

Commits I

6 shortcuts
  • s
    Squash into the commit below
  • f
    Fixup into the commit below
  • r
    Reword the commit
  • d
    Drop the commit
  • i
    Start an interactive rebase
  • ^J
    Move the commit down

Commits II

6 shortcuts
  • ^K
    Move the commit up
  • C
    Copy the commit (cherry-pick)
  • V
    Paste copied commits
  • t
    Revert the commit
  • g
    View reset options
  • A
    Amend with staged changes

Staging Lines & Stash

7 shortcuts
  • TAB
    Switch diff pane
  • a
    Toggle hunk selection
  • SPACE
    Stage the selected lines
  • E
    Edit the hunk
  • RIGHT
    Go to the next hunk
  • LEFT
    Go to the previous hunk
  • ESC
    Back to the side panel

Stash

5 shortcuts
  • SPACE
    Apply the stash entry
  • g
    Pop the stash entry
  • d
    Drop the stash entry
  • n
    New branch from the stash
  • r
    Rename the stash