Menu

Clean Up Messy Git History with Interactive Rebase (squash, fixup, autosquash)
📰

Clean Up Messy Git History with Interactive Rebase (squash, fixup, autosquash)

DEV Community: github·Muiduzzaman Lipu·about 2 hours ago
#vxpqjb5K
#devtogithub#technology#devto#dev#login
Reading 0:00
15s threshold

Your pull request has commits called wip , fix typo and asdf . Before anyone reviews it, let's turn that mess into clean, meaningful commits with git rebase -i .

Every command and hash below came from a real repository I ran this in.

Video version:

Before: a messy branch

$ git log --oneline 2c27ca8 Add login tests fc5d50d asdf 4ffd51f fix typo 3e5db2d wip 3d66ed5 Add login form 6b96e5f Initial commit

Enter fullscreen mode

Exit fullscreen mode

There's one real commit for the login form, three junk commits that are really part of it, and then the tests.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.