Hacker News new | ask | show | jobs
by aaravchen 580 days ago
It took me a number of years of working with git to realize it really really wants you to squash things. Especially if you're sharing branches.

git lets you create as complicated a commit tree as you want, and lets you do merges so you can have a separate commit where multiple changes come together, but realistically it really only works if you use it for a rebase workflow in your branches, squashing all changes into a single commit each time. Merge is an outlier when you need a more powerful tool to join branches but want to keep both of the originals still intact. But that shouldn't be your everyday workflow or you're guaranteed to end up with an unreadable, untraceable, and unmanageable commit graph.

1 comments

Someone should let Linus know that git prefers this workflow. Someone should also let the maintainers of git itself know as well. Both happily employ a merge-based workflow.

What’s actually the case is that your workflow seems best with squash merging. There are a lot of project and teams where this is not the case.