Skip to main content

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

Git commands
CommandGroupDescription
No data yet
Was this helpful?

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 Repositorygit init and git clone.
  • Staging & Committinggit add, git status, git commit, and git diff.
  • Branching — create, rename, delete, and switch branches with git branch, git checkout, and git switch.
  • Merging & Rebasinggit merge, git rebase, and git cherry-pick, including how to abort or continue.
  • Remotegit remote, git fetch, git pull, and git push.
  • Inspecting Historygit log, git show, git blame, and git shortlog.
  • Undoing Changesgit restore, git reset, git revert, and git 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.

gitcheatsheetversion-controlreferencecommands

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.