Cheatography
https://cheatography.com
Whenever you edit a file from a Git repository, a set of commands is defined
that serve as a gateway to Git.
Navigation (open)
|
Open the file or fugitive-object
under the cursor. |
|
Open the file or fugitive-object
under the cursor in a new split. |
|
Open the file or fugitive-object
under the cursor in a new vertical split. |
|
Open the file or fugitive-object
under the cursor in a new tab. |
|
Open the file or fugitive-object
under the cursor in a preview window. |
|
Open the current file in the [count]th
first ancestor. |
|
Open the current file in the [count]th
parent. |
|
Open the commit containing the current file. |
|
Open .git/info/exclude in a split. Use a count to open .gitignore. |
Navigation (jump to file)
|
Jump to file [count] in the "Untracked" or "Unstaged" section. |
|
Jump to file [count] in the "Unstaged" section. |
|
Jump to file [count] in the "Staged" section. |
|
Jump to file [count] in the "Unpushed" section. |
|
Jump to file [count] in the "Unpulled" section. |
|
Jump to file [count] in the "Rebasing" section. |
Staging/unstaging
|
Stage (add) the file or hunk under the cursor. |
|
Unstage (reset) the file or hunk under the cursor. |
|
Stage or unstage the file or hunk under the cursor. |
|
Unstage everything. |
|
Discard the change under the cursor |
|
Toggle an inline diff of the file under the cursor. |
|
Insert an inline diff of the file under the cursor. |
|
Remove the inline diff of the file under the cursor. |
|
Open .git/info/exclude
in a split and add the file under the cursor. |
|
Invoke :Git add --patch
or reset --patch
on the file under the cursor. |
|
On untracked files, this instead calls :Git add --intent-to-add
. |
Checkout/branch
|
Check out the commit under the cursor. |
|
Populate command line with ":Git branch "
. |
|
Populate command line with ":Git checkout "
. |
|
Show this help. |
|
|
Stash
|
Push stash. Pass a [count] of 1 to add --include-untracked
or 2 to add --all
. |
|
Push stash of worktree. Like czz
with --keep-index
. |
|
Apply topmost stash, or stash@{count}. |
|
Apply topmost stash, or stash@{count}, preserving the index. |
|
Pop topmost stash, or stash@{count}. |
|
Pop topmost stash, or stash@{count}, preserving the index. |
|
Populate command line with ":Git stash "
. |
|
Show this help. |
Rebase
|
Perform an interactive rebase. |
|
|
|
Perform an autosquash rebase without editing the todo list. |
|
Perform an interactive rebase against @{upstream}. |
|
Perform an interactive rebase against @{push}. |
|
Continue the current rebase. |
|
Skip the current commit and continue the current rebase. |
|
Abort the current rebase. |
|
Edit the current rebase todo list. |
|
Perform an interactive rebase with the commit under the cursor set to reword
. |
|
Perform an interactive rebase with the commit under the cursor set to edit
. |
|
Perform an interactive rebase with the commit under the cursor set to drop
. |
|
Populate command line with ":Git rebase "
. |
|
Show this help. |
|
|
Navigation (jump)
|
Jump to the previous file, hunk, or revision. |
|
Jump to the next file, hunk, or revision. |
|
Jump to previous hunk, expanding inline diffs automatically. |
|
Jump to next hunk, expanding inline diffs automatically. |
|
Jump to previous file, collapsing inline diffs automatically. |
|
|
|
Jump to next file, collapsing inline diffs automatically. |
|
|
|
Jump to the next file or hunk, expanding inline diffs automatically. |
|
Jump [count] sections backward. |
|
Jump [count] sections forward. |
|
Jump [count] section ends backward. |
|
Jump [count] section ends forward. |
|
On the first column of a + or - diff line, search for the corresponding - or + line. |
|
Same as "*", but search backward. |
Diff
|
Invoke :Git
diff on the file under the cursor. |
|
Perform a :Gdiffsplit
on the file under the cursor. |
|
Perform a :Gvdiffsplit
on the file under the cursor. |
|
Perform a :Ghdiffsplit
on the file under the cursor. |
|
Perform a :Ghdiffsplit
on the file under the cursor. |
|
Close all but one diff buffer, and :diffoff
! the last one. |
|
Show this help. |
Commit
|
Create a commit. |
|
Amend the last commit and edit the message. |
|
Amend the last commit without editing the message. |
|
Reword the last commit. |
|
Create a commit with -v. |
|
Amend the last commit with -v |
|
Revert the commit under the cursor. |
|
Revert the commit under the cursor in the index and work tree, but do not actually commit the changes. |
|
Show this help. |
Commit (command-line)
|
Populate command line with ":Git commit "
. |
|
Populate command line with ":Git revert "
. |
|
Populate command line with ":Git merge "
. |
Commit (create a...)
|
Create a fixup!
commit for the commit under the cursor. |
|
Create a fixup!
commit for the commit under the cursor and immediately rebase it. |
|
Create a squash!
commit for the commit under the cursor. |
|
Create a squash!
commit for the commit under the cursor and immediately rebase it. |
|
Create a squash!
commit for the commit under the cursor and edit the message. |
Miscellaneous
|
Close the status buffer. |
|
Start a :
command line with the file under the cursor prepopulated. |
|
Show help for fugitive-maps
|
Global
|
On the command line, recall the path to the current fugitive-object
|
|
Yank the path to the current fugitive-object
. |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by isaacnewton