Survived a year on add/commit/push. Finally learned rebase and it wasn't the monster I feared
For my entire first year I used exactly three git commands and treated everything else like defusing a bomb. Any time a teammate said "just rebase onto main" I'd nod, then quietly merge instead and hope no one looked at the graph.
This week I sat down and learned interactive rebase, stash, and reflog. Two things surprised me:
- Reflog means you basically can't lose committed work. Once that clicked, most of the fear went with it — even a bad rebase leaves the old commits reachable, so you can always get back to where you were.
- Cleaning up my messy commits before opening a PR made my reviews noticeably easier for people to read.
Not claiming I'm a git wizard now. But the thing I'd built up as a dangerous arcane skill was really a weekend of practice on a throwaway repo. If you've been avoiding it, make a junk repo and break things in it on purpose — nothing's at stake there.
2 comments
- 0
AnonymousAnon Cleaning up commits before a PR genuinely makes you read as more senior than you are — reviewers notice a tidy history. One footgun worth memorizing though: never rebase a branch other people have already pulled from. That's the one that actually bites.
- 0
AnonymousAnon reflog is the single most reassuring git command and nobody teaches it early. The day someone showed me I could undo a "catastrophic" reset in two lines, git stopped being scary. It should be lesson one, not lesson fifty.