Git Cheat Sheet
Searchable reference of the most common Git commands, grouped by task (setup, branching, committing, remotes, undoing changes, stashing and tags). Type to instantly filter the table by command, group or description.
Input
Leave empty to browse every command. Matching is case-insensitive across command, group and description.
Output
| Command | Group | Description |
|---|---|---|
| No data yet | ||
Guides
A fast, searchable reference of the Git commands you reach for every day. Start typing in the search box and the table filters instantly, matching your query against the command itself, the group it belongs to, or its description. Leave the box empty to browse the whole cheat sheet at once.
How to use it
Type a keyword such as branch, commit, stash, rebase, or push. The list narrows in real time, so you can find the exact syntax without scrolling through pages of documentation. Because the search covers descriptions too, you can look up a command by what it does — search undo to surface git reset, git revert, and git restore, or remote to see everything about pushing, pulling, and fetching.
Each row shows the command with its placeholder arguments (written as [branch], [file], [commit], and so on), the task group it fits into, and a plain-language explanation of what it does. Swap the bracketed placeholders for your real branch names, files, or commit hashes when you run the command.
What's covered
The commands are organized into practical groups so related actions sit together:
- Setup & Config — set your name, email, editor, and command aliases.
- Starting a Repository —
git initandgit clone. - Staging & Committing —
git add,git status,git commit, andgit diff. - Branching — create, rename, delete, and switch branches with
git branch,git checkout, andgit switch. - Merging & Rebasing —
git merge,git rebase, andgit cherry-pick, including how to abort or continue. - Remote —
git remote,git fetch,git pull, andgit push. - Inspecting History —
git log,git show,git blame, andgit shortlog. - Undoing Changes —
git restore,git reset,git revert, andgit clean. - Stashing — save and restore work in progress with
git stash. - Tags — create lightweight and annotated tags for releases.
Merge or rebase?
Both combine work from two branches. git merge preserves the exact history and adds a merge commit, while git rebase replays your commits on top of another branch for a linear history. Rebase before you push; avoid rebasing commits others already share.
Reset, revert, or restore?
git restore discards uncommitted changes in your working directory. git reset moves the branch tip and can unstage or discard changes. git revert is the safe option for shared history — it adds a new commit that undoes an old one without rewriting the past.
Is my data private?
Yes. This cheat sheet runs entirely in your browser. Nothing you type is sent to a server, and there is no tracking of your searches.