1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-24 05:36:19 +02:00
lazygit/docs/keybindings/Keybindings_en.md

321 lines
9.6 KiB
Markdown
Raw Normal View History

2022-01-19 21:36:42 +11:00
_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
2019-03-02 15:11:53 +11:00
_Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
## Global Keybindings
2019-03-02 15:11:53 +11:00
<pre>
<kbd>&lt;c-r&gt;</kbd>: switch to a recent repo
<kbd>&lt;pgup&gt;</kbd>: scroll up main panel (fn+up/shift+k)
<kbd>&lt;pgdown&gt;</kbd>: scroll down main panel (fn+down/shift+j)
2023-04-15 14:40:28 +10:00
<kbd>@</kbd>: open command log menu
<kbd>}</kbd>: Increase the size of the context shown around changes in the diff view
<kbd>{</kbd>: Decrease the size of the context shown around changes in the diff view
<kbd>:</kbd>: execute custom command
<kbd>&lt;c-p&gt;</kbd>: view custom patch options
2023-04-15 14:40:28 +10:00
<kbd>m</kbd>: view merge/rebase options
<kbd>R</kbd>: refresh
2020-02-28 09:41:56 +09:00
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode
2023-04-15 14:40:28 +10:00
<kbd>?</kbd>: open menu
<kbd>&lt;c-s&gt;</kbd>: view filter-by-path options
2020-10-02 07:32:48 +10:00
<kbd>W</kbd>: open diff menu
<kbd>&lt;c-e&gt;</kbd>: open diff menu
<kbd>&lt;c-w&gt;</kbd>: Toggle whether or not whitespace changes are shown in the diff view
2022-01-23 14:40:28 +11:00
<kbd>z</kbd>: undo (via reflog) (experimental)
<kbd>&lt;c-z&gt;</kbd>: redo (via reflog) (experimental)
2022-01-23 14:40:28 +11:00
<kbd>P</kbd>: push
<kbd>p</kbd>: pull
2019-03-02 15:11:53 +11:00
</pre>
2020-10-02 07:32:48 +10:00
## List Panel Navigation
2020-03-23 23:22:10 +11:00
<pre>
2021-02-09 20:23:20 +11:00
<kbd>,</kbd>: previous page
<kbd>.</kbd>: next page
<kbd>&lt;</kbd>: scroll to top
2021-02-09 20:23:20 +11:00
<kbd>/</kbd>: start search
<kbd>&gt;</kbd>: scroll to bottom
2022-08-07 11:20:25 +10:00
<kbd>H</kbd>: scroll left
<kbd>L</kbd>: scroll right
2021-02-09 20:23:20 +11:00
<kbd>]</kbd>: next tab
<kbd>[</kbd>: previous tab
2020-03-23 23:22:10 +11:00
</pre>
2022-03-26 14:44:30 +11:00
## Commit Files
2022-02-26 16:29:18 +11:00
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy the committed file name to the clipboard
<kbd>c</kbd>: checkout file
<kbd>d</kbd>: discard this commit's changes to this file
<kbd>o</kbd>: open file
2020-07-21 18:12:05 +10:00
<kbd>e</kbd>: edit file
<kbd>&lt;space&gt;</kbd>: toggle file included in patch
<kbd>a</kbd>: toggle all files included in patch
<kbd>&lt;enter&gt;</kbd>: enter file to add selected lines to the patch (or toggle directory collapsed)
2021-04-06 09:51:04 +10:00
<kbd>`</kbd>: toggle file tree view
2020-03-10 11:54:55 +09:00
</pre>
2023-05-11 19:02:25 +10:00
## Commit Summary
2023-04-15 14:40:28 +10:00
<pre>
<kbd>&lt;enter&gt;</kbd>: confirm
<kbd>&lt;esc&gt;</kbd>: close
2023-04-15 14:40:28 +10:00
</pre>
2022-03-26 14:44:30 +11:00
## Commits
2019-03-02 15:11:53 +11:00
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy commit SHA to clipboard
<kbd>&lt;c-r&gt;</kbd>: reset cherry-picked (copied) commits selection
2022-02-13 10:39:14 +11:00
<kbd>b</kbd>: view bisect options
2019-03-02 15:11:53 +11:00
<kbd>s</kbd>: squash down
<kbd>f</kbd>: fixup commit
<kbd>r</kbd>: reword commit
<kbd>R</kbd>: reword commit with editor
<kbd>d</kbd>: delete commit
<kbd>e</kbd>: edit commit
<kbd>p</kbd>: pick commit (when mid-rebase)
<kbd>F</kbd>: create fixup commit for this commit
2021-06-15 08:37:56 +10:00
<kbd>S</kbd>: squash all 'fixup!' commits above selected commit (autosquash)
<kbd>&lt;c-j&gt;</kbd>: move commit down one
<kbd>&lt;c-k&gt;</kbd>: move commit up one
2022-03-27 18:50:49 +11:00
<kbd>v</kbd>: paste commits (cherry-pick)
2019-03-02 15:11:53 +11:00
<kbd>A</kbd>: amend commit with staged changes
2022-05-07 16:44:45 +02:00
<kbd>a</kbd>: reset commit author
2019-03-02 15:11:53 +11:00
<kbd>t</kbd>: revert commit
2020-02-28 09:41:56 +09:00
<kbd>T</kbd>: tag commit
<kbd>&lt;c-l&gt;</kbd>: open log menu
<kbd>&lt;space&gt;</kbd>: checkout commit
2022-03-24 21:04:33 +01:00
<kbd>y</kbd>: copy commit attribute
<kbd>o</kbd>: open commit in browser
<kbd>n</kbd>: create new branch off of commit
2022-03-26 17:28:37 +11:00
<kbd>g</kbd>: view reset options
<kbd>c</kbd>: copy commit (cherry-pick)
<kbd>C</kbd>: copy commit range (cherry-pick)
<kbd>&lt;enter&gt;</kbd>: view selected item's files
2019-03-02 15:11:53 +11:00
</pre>
2023-04-15 14:40:28 +10:00
## Confirmation Panel
<pre>
<kbd>&lt;enter&gt;</kbd>: confirm
<kbd>&lt;esc&gt;</kbd>: close/cancel
2023-04-15 14:40:28 +10:00
</pre>
2022-03-26 14:44:30 +11:00
## Files
2019-03-16 16:43:13 +09:00
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy the file name to the clipboard
2022-02-26 16:29:18 +11:00
<kbd>d</kbd>: view 'discard changes' options
<kbd>&lt;space&gt;</kbd>: toggle staged
<kbd>&lt;c-b&gt;</kbd>: Filter files (staged/unstaged)
<kbd>c</kbd>: commit changes
<kbd>w</kbd>: commit changes without pre-commit hook
<kbd>A</kbd>: amend last commit
<kbd>C</kbd>: commit changes using git editor
<kbd>e</kbd>: edit file
2019-03-16 16:43:13 +09:00
<kbd>o</kbd>: open file
2022-08-11 14:18:19 +02:00
<kbd>i</kbd>: ignore or exclude file
<kbd>r</kbd>: refresh files
<kbd>s</kbd>: stash all changes
<kbd>S</kbd>: view stash options
<kbd>a</kbd>: stage/unstage all
<kbd>&lt;enter&gt;</kbd>: stage individual hunks/lines for file, or collapse/expand for directory
<kbd>g</kbd>: view upstream reset options
2022-02-26 19:35:30 +11:00
<kbd>D</kbd>: view reset options
2021-03-21 10:56:45 +11:00
<kbd>`</kbd>: toggle file tree view
2021-06-15 08:37:56 +10:00
<kbd>M</kbd>: open external merge tool (git mergetool)
2022-02-13 10:39:14 +11:00
<kbd>f</kbd>: fetch
2020-10-02 07:32:48 +10:00
</pre>
2022-05-10 20:10:59 +09:00
## Local Branches
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy branch name to clipboard
2022-05-10 20:10:59 +09:00
<kbd>i</kbd>: show git-flow options
<kbd>&lt;space&gt;</kbd>: checkout
2022-05-10 20:10:59 +09:00
<kbd>n</kbd>: new branch
<kbd>o</kbd>: create pull request
<kbd>O</kbd>: create pull request options
<kbd>&lt;c-y&gt;</kbd>: copy pull request URL to clipboard
2022-05-10 20:10:59 +09:00
<kbd>c</kbd>: checkout by name
<kbd>F</kbd>: force checkout
<kbd>d</kbd>: delete branch
<kbd>r</kbd>: rebase checked-out branch onto this branch
<kbd>M</kbd>: merge into currently checked out branch
<kbd>f</kbd>: fast-forward this branch from its upstream
2023-02-08 22:40:18 +09:00
<kbd>T</kbd>: create tag
2022-05-10 20:10:59 +09:00
<kbd>g</kbd>: view reset options
<kbd>R</kbd>: rename branch
<kbd>u</kbd>: set/unset upstream
<kbd>&lt;enter&gt;</kbd>: view commits
2022-05-10 20:10:59 +09:00
</pre>
## Main Panel (Merging)
2019-03-02 15:11:53 +11:00
<pre>
2022-08-07 11:20:25 +10:00
<kbd>e</kbd>: edit file
<kbd>o</kbd>: open file
<kbd>&lt;left&gt;</kbd>: select previous conflict
<kbd>&lt;right&gt;</kbd>: select next conflict
<kbd>&lt;up&gt;</kbd>: select previous hunk
<kbd>&lt;down&gt;</kbd>: select next hunk
<kbd>z</kbd>: undo
2022-08-07 11:20:25 +10:00
<kbd>M</kbd>: open external merge tool (git mergetool)
<kbd>&lt;space&gt;</kbd>: pick hunk
2022-08-07 11:20:25 +10:00
<kbd>b</kbd>: pick all hunks
<kbd>&lt;esc&gt;</kbd>: return to files panel
2019-03-02 15:11:53 +11:00
</pre>
## Main Panel (Normal)
<pre>
<kbd>mouse wheel down</kbd>: scroll down (fn+up)
<kbd>mouse wheel up</kbd>: scroll up (fn+down)
</pre>
## Main Panel (Patch Building)
<pre>
<kbd>&lt;left&gt;</kbd>: select previous hunk
<kbd>&lt;right&gt;</kbd>: select next hunk
<kbd>v</kbd>: toggle drag select
<kbd>V</kbd>: toggle drag select
<kbd>a</kbd>: toggle select hunk
<kbd>&lt;c-o&gt;</kbd>: copy the selected text to the clipboard
<kbd>o</kbd>: open file
<kbd>e</kbd>: edit file
<kbd>&lt;space&gt;</kbd>: add/remove line(s) to patch
<kbd>&lt;esc&gt;</kbd>: exit custom patch builder
</pre>
## Main Panel (Staging)
2019-03-02 15:11:53 +11:00
<pre>
<kbd>&lt;left&gt;</kbd>: select previous hunk
<kbd>&lt;right&gt;</kbd>: select next hunk
2020-02-28 09:41:56 +09:00
<kbd>v</kbd>: toggle drag select
<kbd>V</kbd>: toggle drag select
<kbd>a</kbd>: toggle select hunk
<kbd>&lt;c-o&gt;</kbd>: copy the selected text to the clipboard
<kbd>o</kbd>: open file
<kbd>e</kbd>: edit file
<kbd>&lt;esc&gt;</kbd>: return to files panel
<kbd>&lt;tab&gt;</kbd>: switch to other panel (staged/unstaged changes)
<kbd>&lt;space&gt;</kbd>: toggle line staged / unstaged
<kbd>d</kbd>: delete change (git reset)
2022-05-04 21:20:45 +09:00
<kbd>E</kbd>: edit hunk
<kbd>c</kbd>: commit changes
<kbd>w</kbd>: commit changes without pre-commit hook
<kbd>C</kbd>: commit changes using git editor
2019-03-02 15:11:53 +11:00
</pre>
2023-04-15 14:40:28 +10:00
## Menu
<pre>
<kbd>&lt;enter&gt;</kbd>: execute
<kbd>&lt;esc&gt;</kbd>: close
2023-04-15 14:40:28 +10:00
</pre>
2022-03-26 14:44:30 +11:00
## Reflog
2020-03-10 11:54:55 +09:00
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy commit SHA to clipboard
<kbd>&lt;space&gt;</kbd>: checkout commit
2022-03-26 17:28:37 +11:00
<kbd>y</kbd>: copy commit attribute
<kbd>o</kbd>: open commit in browser
<kbd>n</kbd>: create new branch off of commit
2022-03-26 14:44:30 +11:00
<kbd>g</kbd>: view reset options
<kbd>c</kbd>: copy commit (cherry-pick)
<kbd>C</kbd>: copy commit range (cherry-pick)
<kbd>&lt;c-r&gt;</kbd>: reset cherry-picked (copied) commits selection
<kbd>&lt;enter&gt;</kbd>: view commits
2020-03-10 11:54:55 +09:00
</pre>
2022-03-26 14:44:30 +11:00
## Remote Branches
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy branch name to clipboard
<kbd>&lt;space&gt;</kbd>: checkout
2022-03-26 14:44:30 +11:00
<kbd>n</kbd>: new branch
<kbd>M</kbd>: merge into currently checked out branch
<kbd>r</kbd>: rebase checked-out branch onto this branch
<kbd>d</kbd>: delete branch
<kbd>u</kbd>: set as upstream of checked-out branch
<kbd>&lt;esc&gt;</kbd>: Return to remotes list
2022-03-26 14:44:30 +11:00
<kbd>g</kbd>: view reset options
<kbd>&lt;enter&gt;</kbd>: view commits
2022-03-26 14:44:30 +11:00
</pre>
## Remotes
<pre>
<kbd>f</kbd>: fetch remote
<kbd>n</kbd>: add new remote
<kbd>d</kbd>: remove remote
<kbd>e</kbd>: edit remote
</pre>
## Stash
<pre>
<kbd>&lt;space&gt;</kbd>: apply
<kbd>g</kbd>: pop
<kbd>d</kbd>: drop
2020-10-02 07:32:48 +10:00
<kbd>n</kbd>: new branch
2022-10-14 22:19:53 +09:00
<kbd>r</kbd>: rename stash
<kbd>&lt;enter&gt;</kbd>: view selected item's files
</pre>
2022-03-26 14:44:30 +11:00
## Status
<pre>
<kbd>o</kbd>: open config file
2023-04-15 14:40:28 +10:00
<kbd>e</kbd>: edit config file
<kbd>u</kbd>: check for update
<kbd>&lt;enter&gt;</kbd>: switch to a recent repo
2021-02-09 20:23:20 +11:00
<kbd>a</kbd>: show all branch logs
</pre>
2022-03-26 14:44:30 +11:00
## Sub-commits
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy commit SHA to clipboard
<kbd>&lt;space&gt;</kbd>: checkout commit
2022-03-26 17:28:37 +11:00
<kbd>y</kbd>: copy commit attribute
<kbd>o</kbd>: open commit in browser
<kbd>n</kbd>: create new branch off of commit
<kbd>g</kbd>: view reset options
<kbd>c</kbd>: copy commit (cherry-pick)
<kbd>C</kbd>: copy commit range (cherry-pick)
<kbd>&lt;c-r&gt;</kbd>: reset cherry-picked (copied) commits selection
<kbd>&lt;enter&gt;</kbd>: view selected item's files
</pre>
2022-03-26 14:44:30 +11:00
## Submodules
<pre>
<kbd>&lt;c-o&gt;</kbd>: copy submodule name to clipboard
<kbd>&lt;enter&gt;</kbd>: enter submodule
2022-03-26 14:44:30 +11:00
<kbd>d</kbd>: remove submodule
<kbd>u</kbd>: update submodule
<kbd>n</kbd>: add new submodule
<kbd>e</kbd>: update submodule URL
<kbd>i</kbd>: initialize submodule
<kbd>b</kbd>: view bulk submodule options
</pre>
## Tags
<pre>
<kbd>&lt;space&gt;</kbd>: checkout
2022-03-26 14:44:30 +11:00
<kbd>d</kbd>: delete tag
<kbd>P</kbd>: push tag
<kbd>n</kbd>: create tag
<kbd>g</kbd>: view reset options
<kbd>&lt;enter&gt;</kbd>: view commits
2022-03-26 14:44:30 +11:00
</pre>