Closed Kwpolska closed 5 months ago
@Kwpolska actually you can force squash merges, assuming you have access to the repo's settings, by disabling both "Allow merge commits" and "Allow rebase merging". Also you can add/modify a branch protection for the main
branch and enable "Require linear history" there (make sure that "Do not allow bypassing the above settings" is also checked), which will disallow pushing merge commits to that branch.
Thanks, I only looked in the branch protection options, I didn’t know about the options on the main settings page. I disabled the other merge options and removed probably from the added line.
Yeah, the settings are quite spread out, it always takes me some time to find them all, even knowing that they exist :) (Especially when changing between GitHub and GitLab; both have their own settings maze...)
(Or Azure DevOps, the original Microsoft GitHub I use at work, which considers merge types part of branch policy.)
Squash merges make history cleaner. I can’t force squash merges, but I can at least disable merge commits, so squash merges are the most likely.