← All notes

· 1 min read

Git commands I actually use

The small set of Git commands that cover 95% of my day.

Git has hundreds of commands. These are the ones I really use.

Everyday

git status            # what changed?
git add -p            # stage changes piece by piece
git commit -m "msg"   # save a snapshot
git push              # send to remote

Fixing mistakes

git commit --amend          # fix the last commit message
git restore <file>          # discard local changes to a file
git stash && git stash pop  # park work temporarily

Exploring history

git log --oneline --graph   # compact history
git blame <file>            # who changed each line
Enjoyed this note? Buy me a coffee ☕