Git has well over a hundred subcommands, and each of them sprouts flags like a hedge in spring. Nobody memorizes all of it — not maintainers, not the people who write Git books. Yet a small core of commands accounts for the overwhelming majority of daily use, and being fluent in that core is one of the highest-leverage skills a developer can build. It's also a quiet interview signal: candidates who fumble a basic rebase question read as less experienced than they are.
This guide sorts Git into three tiers — memorize, recognize, and look up — and ends with a retention routine that keeps the first tier sharp.
Tier 1: Memorize — the daily loop
These commands are your hands-on-the-wheel set. You should be able to type them without thinking, including their most common flags:
git statusandgit log --oneline— orientation. You should reach for these reflexively before and after anything risky.git add -p— staging by hunk. Reviewing your own diff as you stage it catches an astonishing number of mistakes before they're committed.git commit -mandgit commit --amend— making history, and fixing the commit you made ten seconds ago.git diffandgit diff --staged— what changed, and what's about to be committed. Knowing the difference between the two is itself a common gotcha.git switch -c(orgit checkout -b) — branching. Cheap branches are the whole point of Git.git pull,git push, andgit fetch— and crucially, the conceptual difference:fetchdownloads without touching your work;pullis a fetch plus a merge or rebase.git stashandgit stash pop— the escape hatch for "I need a clean tree right now."git mergeandgit rebase— at minimum, what each does to history and when your team prefers one over the other.
Tier 2: Recognize — the recovery kit
You don't need these daily, but when you need them, you're usually stressed, and half-remembering them is dangerous. Aim to know what each does and that it exists; keep the exact syntax in a reference:
git resetin its three moods —--soft,--mixed, and--hard. The difference between "unstage my changes" and "destroy my changes" is one flag. This is the single most important gotcha in Git.git restore— the modern, clearer way to discard working-tree changes or unstage files.git revert— undoing a commit safely on a shared branch, by adding a new commit rather than rewriting history.git cherry-pick— pulling one commit onto another branch.git reflog— the "undelete" command. Almost nothing in Git is truly lost; the reflog is how you get it back after a bad reset or rebase.git bisect— binary-searching history for the commit that introduced a bug. Rarely needed; unforgettable once it saves you.
Tier 3: Look up — don't clutter your memory
Interactive rebase incantations, git filter-repo, submodule commands, worktree management, tracing options for git log, the long tail of git config keys — these belong in a cheat sheet, full stop. The skill worth building here isn't recall; it's knowing the command exists and where to find the exact syntax in seconds. Trying to memorize Tier 3 crowds out the Tier 1 fluency that actually pays daily dividends.
The gotchas that separate fluent from fumbling
Whatever you memorize, learn the failure modes with it:
reset --harddiscards uncommitted work permanently. Stash first, or make a safety commit.- Never rewrite shared history. Rebase and amend are for commits you haven't pushed (or branches only you use);
revertis for everything public. pullcan create surprise merge commits. Know whether your setup merges or rebases on pull, and why.- Detached HEAD isn't broken. It's just a state — but committing there without creating a branch is how work goes missing.
A retention routine for Tier 1
Fluency comes from retrieval, not rereading. Twice a week, give yourself task-shaped prompts — "unstage this file," "move my last two commits onto main," "throw away everything since the last commit" — and write the command from memory before checking a reference. Log any miss and re-test it a few days later. Because Tier 1 commands come up constantly in real work, deliberate practice converges fast: most developers can make the whole tier automatic in two or three weeks. (The same routine works for any language; see our guide on syntax recall for coding interviews.)
Where SyntaxShelf fits in
SyntaxShelf includes a focused Git cheat sheet alongside its JavaScript, Python, SQL, Bash/Linux, and other references. Its task-first search is built for exactly the Tier 2 and Tier 3 moments — you know you need to "undo the last commit" and want the exact command with a copyable example, plus the common mistakes called out next to it. You can favorite your Tier 1 set, attach personal notes (stored on your device), and because the app works offline after install with no ads or account, the answer is there even when you're on a train with no signal.