Squash, merge commit or rebase: what do you set as the allowed method on production repos and why?
IntermediateProductionBranching and workflow design
Answer
For services we allow squash only. One PR becomes one commit on main, which makes git revert of a whole feature trivial, keeps git log --first-parent meaningful, and lets the PR title carry the Conventional Commit message. For release branches we allow merge commits so forward-merging fixes does not produce duplicate commits. We disable the methods we do not want in repo settings so reviewers do not argue about it.
More on Branching and workflow design
How would you choose a branching strategy for a team of 40 engineers shipping a SaaS product several times a day?IntermediateWhen is GitFlow still the right choice in 2026?IntermediateHow do you support multiple released versions (1.x, 2.x, 3.x) without chaos?AdvancedHow do feature flags change your merge and release process?IntermediateWhat branch naming and commit conventions do you enforce and how?BeginnerDesign a branching and release process for a monorepo with 15 services deployed independently.Advanced