People tend to get pretty passionate about Git workflows on different online forums. Some like to rebase, while others prefer to keep the disorganized records. Some dislike the extra merge commit, while others love to preserve all the historical artifacts. There’s merit to both sides of the discussion. That being said, I kind of like rebasing because I’m a messy committer who:
- Usually doesn’t care for keeping atomic commits.
- Creates a lot of short commits with messages like “fix” or “wip”.
- Likes to clean up the untidy commits before sending the branch for peer review.
- Prefers a linear history over a forked one so that
git log --oneline --graphtells a nice story.
Git rebase allows me to squash my disordered commits into a neat little one, which bundles
all the changes with passing tests and documentation. Sure, a similar result can be emulated
using git merge --squash feat_branch or GitHub’s squash-merge feature, but to me, rebasing
feels cleaner. Plus, over time, I’ve subconsciously picked up the tricks to work my way
around rebase-related gotchas.