getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.58k stars 443 forks source link

CONTRIBUTING.rst: inform about squash merges #3747

Closed Kwpolska closed 5 months ago

Kwpolska commented 5 months ago

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.

felixfontein commented 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.

Kwpolska commented 5 months ago

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.

felixfontein commented 5 months ago

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...)

Kwpolska commented 5 months ago

(Or Azure DevOps, the original Microsoft GitHub I use at work, which considers merge types part of branch policy.)