Git Command Cheat Sheet — Free
Runs 100% in your browser — your files never leave your device.
Git has a small daily core and a long tail of commands you need just often enough to forget. Search a practical reference covering repository setup, staging, history, branching, remotes, stashing, tagging, bisecting, and blame, then copy any command.
How it works
- 1
Search by task or command
- 2
Read the concise explanation
- 3
Copy the command
About this tool
The commands that cover 90 percent of work
clone, status, add, commit, push, pull, log, diff, branch, checkout, and merge carry daily development. The sheet groups them by workflow — starting, saving, sharing, inspecting, fixing — so the command you need is one scan away instead of one search away.
The fixing-your-mistakes section
The commands people search for at panic time: restore a modified file, undo the last commit while keeping the changes, amend a message, and find the commit that broke everything. Read that section before you need it — knowing restore exists changes how bold you can be.
When to search beyond the sheet
Rebasing history, cherry-picking, and submodules have legitimate moment-by-moment uses but also footguns the sheet deliberately keeps brief. When a fix-up command touches shared history, read the full documentation before running it — force-pushes to shared branches are how teams lose afternoons.
Frequently asked questions
What is the difference between merge and rebase?
Merge records both histories with a join commit; rebase replays your commits on top of the target, producing a linear history. Rebase rewrites commits — never rebase commits others have already pulled.
I committed to the wrong branch — what now?
If nothing is pushed: switch to the right branch and the commit follows with a cherry-pick, or reset the wrong branch. The sheet's undo section walks the safe variant of each.
How do I see what changed before pulling?
Fetch first, then diff your branch against the fetched one — fetch updates remote refs without touching your working files, so the diff is read-only.