Git Command Cheat Sheet
Use this local reference for everyday Git inspection, staging, commits, branches, and remotes. Mutating commands are clearly marked; destructive commands are omitted.
Mutating commands are marked. Destructive commands are omitted from this reference.
A QUICK WALKTHROUGH
How to use this tool
- Choose a command family.
- Read the command syntax, purpose, and safety note.
- Copy the command when you are ready to run it in your own repository.
Curated and bounded
The sheet covers common status, history, diff, staging, commit, branch, remote, and recovery inspection commands. It is a quick reference, not a complete Git manual.
Safety labels
Read-only commands are labelled safe. Commands that change the index, working tree, or refs are labelled mutating and should be reviewed before running. Destructive reset, clean, force-push, and similar commands are omitted.
Repository context matters
Review the path, branch, remote, and staged diff before changing a repository. Shell quoting, hooks, permissions, and team policy can affect results.
GOOD TO KNOW
Common questions
Does this run Git commands?
No. It only displays a local reference and copies text.
Are destructive commands included?
No. Destructive commands are intentionally omitted.
Can I use these commands in any repository?
Most are broadly applicable, but review repository policy and command context before mutating operations.