In my experience, devs rarely pay attention to this, so commit messages end up as a big list of:
* Ticket-1234 feature
* fix
* cleanups
* fix
* another fix
* now the real fix
Which I wouldn't qualify as a contributor to a "clean" history. It'd be great if GitHub's UX around crafting the commit messages would be more considerate and foster more meaningful commit messages.(edit: formatting)
There’s no way to automate version control.
One argument, and which I hear often, is that they want to keep the git history clean.
The other argument is that keeping things rebased & squashed allows you to do reverts easily.
I personally don't mind the merge commits cluttering the history, and especially when working on a longer lived branch I will always prefer merging-in changes rather than constantly rebasing and fixing same conflicts ad nauseam.
git revert -m 1 $commit
You can also visualize a clean history with merge commits.
git log —-first-parent
The only argument I’ve heard that holds weight is that GitHub’s UI squashes the merge commit history into a linear view.
Also it'll be harder to go back and review changes when troubleshooting issues because formatting changes were squashed together with business logic changes. With merges at least there are still original commits available, and it'll be possible to either rollback everything or a single commit.