Git's Interface Problem
Git is powerful but its interface is famously unfriendly. Commands like git rebase --interactive --autosquash HEAD~5 are powerful once you understand them but opaque until you do. A command explainer translates the flags, options, and behavior into plain English — telling you not just what each flag does mechanically but what the command is actually useful for and when to reach for it.
Essential Git Commands by Task
Staging & Committing
git add -p # Stage changes interactively — review each hunk
git commit -m "..." # Commit with a message (non-interactive)
git commit --amend # Add changes to the last commit (amend message too)
Branching
git branch # List local branches
git branch -d NAME # Delete a merged branch
git checkout -b NAME # Create and switch to a new branch
git switch -c NAME # Same as above (newer, clearer syntax)
Merging & Rebasing
git merge BRANCH # Merge branch into current branch (creates merge commit)
git rebase MAIN # Replay current branch's commits on top of main (linear history)
git rebase -i HEAD~3 # Interactive rebase — squash, reword, reorder last 3 commits
git cherry-pick SHA # Apply a single commit from another branch
Inspecting History
git log --oneline --graph --all # Compact, visual history of all branches
git show SHA # View a specific commit's changes
git blame FILE # Who last changed each line (and when)
git diff # Unstaged changes
git diff --staged # Staged changes (what will be committed)
git reflog # Everything HEAD has pointed at — undo recovery tool
Undoing
git reset HEAD FILE # Unstage a file
git checkout -- FILE # Discard local changes to a file (destructive!)
git revert SHA # Create a new commit that undoes a specific commit (safe)
git reset --hard SHA # Move HEAD and branch pointer back (destructive!)
Remote
git pull --rebase # Fetch + rebase (cleaner than merge-based pull)
git fetch --prune # Fetch + remove local refs for deleted remote branches
git push -u origin BR # Push branch and set upstream tracking
Understand Any Git Command Instantly
Use ToolsVito's Git Command Explainer to get a plain-English explanation of any git command, its flags, and when to use it. No more man-page decoding.