1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
lazygit/docs/keybindings/Keybindings_en.md
2022-04-11 14:04:06 +02:00

8.5 KiB

This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run go run scripts/cheatsheet/main.go generate from the project root.

Lazygit Keybindings

Global Keybindings

  ctrl+r: switch to a recent repo
  pgup: scroll up main panel (fn+up)
  pgdown: scroll down main panel (fn+down)
  m: view merge/rebase options
  ctrl+p: view custom patch options
  R: refresh
  x: open menu
  +: next screen mode (normal/half/fullscreen)
  _: prev screen mode
  ctrl+s: view filter-by-path options
  W: open diff menu
  ctrl+e: open diff menu
  @: open command log menu
  }: Increase the size of the context shown around changes in the diff view
  {: Decrease the size of the context shown around changes in the diff view
  :: execute custom command
  z: undo (via reflog) (experimental)
  ctrl+z: redo (via reflog) (experimental)
  P: push
  p: pull

List Panel Navigation

  .: next page
  ,: previous page
  <: scroll to top
  >: scroll to bottom
  /: start search
  H: scroll left
  L: scroll right
  ]: next tab
  [: previous tab

Branches

  ctrl+o: copy branch name to clipboard
  i: show git-flow options
  space: checkout
  n: new branch
  o: create pull request
  O: create pull request options
  ctrl+y: copy pull request URL to clipboard
  c: checkout by name
  F: force checkout
  d: delete branch
  r: rebase checked-out branch onto this branch
  M: merge into currently checked out branch
  f: fast-forward this branch from its upstream
  g: view reset options
  R: rename branch
  u: set/unset upstream
  enter: view commits

Commit Files

  ctrl+o: copy the committed file name to the clipboard
  c: checkout file
  d: discard this commit's changes to this file
  o: open file
  e: edit file
  space: toggle file included in patch
  a: toggle all files included in patch
  enter: enter file to add selected lines to the patch (or toggle directory collapsed)
  `: toggle file tree view

Commits

  ctrl+o: copy commit SHA to clipboard
  ctrl+r: reset cherry-picked (copied) commits selection
  b: view bisect options
  s: squash down
  f: fixup commit
  r: reword commit
  R: reword commit with editor
  d: delete commit
  e: edit commit
  p: pick commit (when mid-rebase)
  F: create fixup commit for this commit
  S: squash all 'fixup!' commits above selected commit (autosquash)
  ctrl+j: move commit down one
  ctrl+k: move commit up one
  v: paste commits (cherry-pick)
  A: amend commit with staged changes
  t: revert commit
  T: tag commit
  ctrl+l: open log menu
  space: checkout commit
  y: copy commit attribute
  o: open commit in browser
  n: create new branch off of commit
  g: view reset options
  c: copy commit (cherry-pick)
  C: copy commit range (cherry-pick)
  enter: view selected item's files

Files

  ctrl+o: copy the file name to the clipboard
  ctrl+w: Toggle whether or not whitespace changes are shown in the diff view
  d: view 'discard changes' options
  space: toggle staged
  ctrl+b: Filter files (staged/unstaged)
  c: commit changes
  w: commit changes without pre-commit hook
  A: amend last commit
  C: commit changes using git editor
  e: edit file
  o: open file
  i: add to .gitignore
  r: refresh files
  s: stash changes
  S: view stash options
  a: stage/unstage all
  enter: stage individual hunks/lines for file, or collapse/expand for directory
  g: view upstream reset options
  D: view reset options
  `: toggle file tree view
  M: open external merge tool (git mergetool)
  f: fetch

Main Panel (Merging)

  esc: return to files panel
  M: open external merge tool (git mergetool)
  space: pick hunk
  b: pick all hunks
  : select previous conflict
  : select next conflict
  : select previous hunk
  : select next hunk
  e: edit file
  o: open file
  z: undo

Main Panel (Normal)

  mouse wheel down: scroll down (fn+up)
  mouse wheel up: scroll up (fn+down)

Main Panel (Patch Building)

  esc: exit line-by-line mode
  o: open file
  : select previous line
  : select next line
  : select previous hunk
  : select next hunk
  ctrl+o: copy the selected text to the clipboard
  space: add/remove line(s) to patch
  v: toggle drag select
  V: toggle drag select
  a: toggle select hunk

Main Panel (Staging)

  esc: return to files panel
  space: toggle line staged / unstaged
  d: delete change (git reset)
  tab: switch to other panel
  o: open file
  : select previous line
  : select next line
  : select previous hunk
  : select next hunk
  ctrl+o: copy the selected text to the clipboard
  e: edit file
  v: toggle drag select
  V: toggle drag select
  a: toggle select hunk

Reflog

  ctrl+o: copy commit SHA to clipboard
  space: checkout commit
  y: copy commit attribute
  o: open commit in browser
  n: create new branch off of commit
  g: view reset options
  c: copy commit (cherry-pick)
  C: copy commit range (cherry-pick)
  ctrl+r: reset cherry-picked (copied) commits selection
  enter: view commits

Remote Branches

  space: checkout
  n: new branch
  M: merge into currently checked out branch
  r: rebase checked-out branch onto this branch
  d: delete branch
  u: set as upstream of checked-out branch
  esc: Return to remotes list
  g: view reset options
  enter: view commits

Remotes

  f: fetch remote
  n: add new remote
  d: remove remote
  e: edit remote

Stash

  space: apply
  g: pop
  d: drop
  n: new branch
  enter: view selected item's files

Status

  e: edit config file
  o: open config file
  u: check for update
  enter: switch to a recent repo
  a: show all branch logs

Sub-commits

  ctrl+o: copy commit SHA to clipboard
  space: checkout commit
  y: copy commit attribute
  o: open commit in browser
  n: create new branch off of commit
  g: view reset options
  c: copy commit (cherry-pick)
  C: copy commit range (cherry-pick)
  ctrl+r: reset cherry-picked (copied) commits selection
  enter: view selected item's files

Submodules

  ctrl+o: copy submodule name to clipboard
  enter: enter submodule
  d: remove submodule
  u: update submodule
  n: add new submodule
  e: update submodule URL
  i: initialize submodule
  b: view bulk submodule options

Tags

  space: checkout
  d: delete tag
  P: push tag
  n: create tag
  g: view reset options
  enter: view commits