Git Command Cheat Sheet
A searchable reference of common Git commands — branching, merging, remotes, history, undo, stash, and tags — with one-click copy.
| Category | Command | Description | |
|---|---|---|---|
Setup | git init | Create a new local repository | |
Setup | git clone <url> | Clone a remote repository | |
Basics | git status | Show working tree status | |
Basics | git add <file> | Stage a file for commit | |
Basics | git add -p | Interactively stage hunks | |
Basics | git commit -m "msg" | Commit staged changes | |
Basics | git commit --amend | Modify the last commit | |
Branching | git branch | List 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~n | Interactively rewrite the last n commits | |
Merging | git cherry-pick <sha> | Apply a specific commit onto the current branch | |
Remote | git remote -v | List remotes | |
Remote | git fetch | Download objects/refs without merging | |
Remote | git pull | Fetch and merge from a remote | |
Remote | git push | Upload local commits to a remote | |
Remote | git push -u origin <branch> | Push and set upstream tracking | |
History | git log --oneline | Compact commit history | |
History | git log --graph --all | Visualize branch history | |
History | git diff | Show unstaged changes | |
History | git diff --staged | Show 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~1 | Undo last commit, keep changes staged | |
Undo | git reset --hard HEAD~1 | Undo last commit and discard changes | |
Undo | git revert <sha> | Create a new commit that undoes a commit | |
Stash | git stash | Temporarily shelve changes | |
Stash | git stash pop | Reapply the most recent stash | |
Stash | git stash list | List all stashes | |
Tags | git tag <name> | Create a lightweight tag | |
Tags | git tag -a <name> -m "msg" | Create an annotated tag | |
Tags | git push --tags | Push 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.