3 ms·
Like everything, "squashing commits" has good use cases and bad use cases. They have all been documented to death but just as a quick reminder: Bad: squashing
by hota_mazi 9y ago
Like everything, "squashing commits" has good use cases and bad use cases. They have all been documented to death but just as a quick reminder:
Bad: squashing commits that have been pushed. Very bad. Not just because it rewrites history but because it's going to cause headaches to other people.
Good: squashing commits in your own local branch before pushing to origin. In my opinion, this is not just good, it's excellent. Nobody on my team needs to know how many micro commits or dead ends and backtracks I've gone through before I reached the current shape of the code I'm about to push. I love squashing in this situation so I can rearrange and make the commit more pretty before it becomes public.
On top of that, I'd argue that this kind of commit squashing contributes to making better commit logs.
- Fice 9y agoIn Fossil the good use case is supported by using private branches: when you merge a private branch into a public branch, only the merge commit is pushed, the private branch remains private.