Git Command Cheat Sheet

A searchable reference of common Git commands — branching, merging, remotes, history, undo, stash, and tags — with one-click copy.

CategoryCommandDescription
Setup
git initCreate a new local repository
Setup
git clone <url>Clone a remote repository
Basics
git statusShow working tree status
Basics
git add <file>Stage a file for commit
Basics
git add -pInteractively stage hunks
Basics
git commit -m "msg"Commit staged changes
Basics
git commit --amendModify the last commit
Branching
git branchList local branches
Branching
git branch <name>Create a new branch
Branching
git switch <name>Switch to a branch
Branching
git switch -c <name>Create and switch to a new branch
Branching
git branch -d <name>Delete a merged branch
Branching
git branch -D <name>Force delete a branch
Merging
git merge <branch>Merge a branch into the current one
Merging
git rebase <branch>Reapply commits on top of another base
Merging
git rebase -i HEAD~nInteractively rewrite the last n commits
Merging
git cherry-pick <sha>Apply a specific commit onto the current branch
Remote
git remote -vList remotes
Remote
git fetchDownload objects/refs without merging
Remote
git pullFetch and merge from a remote
Remote
git pushUpload local commits to a remote
Remote
git push -u origin <branch>Push and set upstream tracking
History
git log --onelineCompact commit history
History
git log --graph --allVisualize branch history
History
git diffShow unstaged changes
History
git diff --stagedShow staged changes
History
git blame <file>Show who last changed each line
Undo
git restore <file>Discard unstaged changes to a file
Undo
git restore --staged <file>Unstage a file
Undo
git reset --soft HEAD~1Undo last commit, keep changes staged
Undo
git reset --hard HEAD~1Undo last commit and discard changes
Undo
git revert <sha>Create a new commit that undoes a commit
Stash
git stashTemporarily shelve changes
Stash
git stash popReapply the most recent stash
Stash
git stash listList all stashes
Tags
git tag <name>Create a lightweight tag
Tags
git tag -a <name> -m "msg"Create an annotated tag
Tags
git push --tagsPush all tags to remote

Git Command Cheat Sheet — Free Online Tool

A searchable reference of common Git commands — branching, merging, remotes, history, undo, stash, and tags — with one-click copy.

How to use the Git Command Cheat Sheet

  • Open the tool above — it runs entirely in your browser, so your input never leaves this page.
  • Paste or type your input into the field, then press the relevant button (e.g. Encode / Decode, Generate, or Convert).
  • Copy the result from the output area with the copy button orCtrl/Cmd + C.
  • No signup, no upload, and no tracking — repeat as often as you need.

Frequently asked questions

Is the Git Command Cheat Sheet free to use?

Yes. The Git Command Cheat Sheet is completely free, with no signup, no ads inside the tool, and no hidden limits.

Does the Git Command Cheat Sheet upload my data?

No. The Git Command Cheat Sheet processes everything locally in your browser. Your input is never sent to a server, so it stays private even on shared devices.

Does the Git Command Cheat Sheet work offline?

After the page loads, the Git Command Cheat Sheet runs entirely in your browser, so it keeps working without a network connection.

Free & private — why use this Git Command Cheat Sheet

The Git Command Cheat Sheet runs 100% client-side in your browser. Your data is never uploaded to a server, no account is required, and the tool is completely free. It works offline once the page has loaded and is part of a growing collection of privacy-first developer utilities.

More devops & date/time tools