Git commands for daily work
Ninety percent of git use is this handful of commands. Learn `switch` and `restore` — they split the overloaded `checkout` into two clear jobs.
#git#branch#commit#rebase
bash
git switch -c feature/search # new branch
git add -p # stage hunks interactively
git commit -m "Add search filter"
git push -u origin feature/search
git fetch origin
git rebase origin/main # replay your work on top of main
git log --oneline --graph -20Related
Undoing things in git
Pick by blast radius: `restore` for files, `reset --soft` to re-do a commit message, `revert` for anything already pushed, `reflog` when you think work is gone.
REST basics
Nouns in the path, verbs in the method. GET must be safe and cacheable, PUT/DELETE idempotent, POST neither.