Git

Git Shortcuts

Git CLI command reference for version control — staging, committing, branching and remote operations.

Source: Official documentation · Updated 2025-05

Shortcuts
5
Categories

Cheat sheet guide

Git shortcuts worth learning first

This page collects 32 searchable Git keyboard shortcuts across 5 categories. Start with the shortcuts for Setup & Init, Staging & Committing, Branches, Remote, then print the cheat sheet once the important ones are worth keeping nearby.

  • Switch OS tabs for Windows, macOS, or Linux shortcuts.
  • Use / to jump to search instantly.
  • Use Compare mode when moving between machines.
  • Print or save the page as a compact PDF cheat sheet.
Setup & Init 4 shortcuts
git init
gitinit
git clone <url>
gitclone<url>
git config --global user.name
gitconfig--globaluser.name
git config --global user.email
gitconfig--globaluser.email
Staging & Committing 8 shortcuts
git status
gitstatus
git add <file>
gitadd<file>
git add . (stage all)
gitadd.
git commit -m "msg"
gitcommit-m"msg"
git commit --amend
gitcommit--amend
git reset HEAD <file> (unstage)
gitresetHEAD<file>
git diff (unstaged changes)
gitdiff
git diff --staged
gitdiff--staged
Branches 7 shortcuts
git branch (list)
gitbranch
git branch <name> (create)
gitbranch<name>
git checkout <branch>
gitcheckout<branch>
git checkout -b <branch> (create+switch)
gitcheckout-b<branch>
git merge <branch>
gitmerge<branch>
git branch -d <branch> (delete)
gitbranch-d<branch>
git rebase <branch>
gitrebase<branch>
Remote 6 shortcuts
git remote -v (list remotes)
gitremote-v
git fetch
gitfetch
git pull
gitpull
git push
gitpush
git push -u origin <branch>
gitpush-uorigin<branch>
git push --force-with-lease
gitpush--force-with-lease
Log & History 7 shortcuts
git log
gitlog
git log --oneline
gitlog--oneline
git log --graph --oneline
gitlog--graph--oneline
git show <commit>
gitshow<commit>
git stash
gitstash
git stash pop
gitstashpop
git reset --hard HEAD
gitreset--hardHEAD

Frequently asked questions

What is the fastest way to find Git shortcuts on this page?

Use the search box or press /, then type an action such as git init.

Can I print this Git shortcut cheat sheet?

Yes. Use the Print / PDF button or your browser print command to save a compact cheat sheet.

Does this page include Windows and Mac shortcuts for Git?

Yes. Use the OS tabs to switch between Windows and macOS shortcuts. For example, git init is git init on Windows and git init on macOS where available.

Advertisement
No shortcuts match your search.