Interactive Rebase on Initial Commit
I often find myself at the beginning of a project wanting to rebase the first few messy commits into something a bit more meaningful. Often I'll want to squash down my first few messy commits:
c88ab47c ah, finally it is working ✅
3e0811d9 wtf 🤯
1107cc42 asdf...
884ae3bc oh, and this one...
06f7e020 oops, I forgot this thing...
184ab62e initial commit
Back into a clean:
018cc10d chore: initial commit - let's do this 🔥
I've had to do this a few times, and I always forget the syntax, so I am recording it here for my future self.
Shout-out to this stack overflow answer that I always eventually find every time I Google this issue.
git rebase --interactive --root
And there it is 😎