Interview Prep/Git & GitHub/Branching and workflow design

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.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching and workflow design