Ensure branch requires linear history
A linear commit history prevents collaborators from pushing merge commits to the branch. Any pull requests merged into the protected branch must use squash or rebase merge. A strictly linear commit history can help teams reverse changes more easily.
Risk Level: medium
Platform: Github
Spectral Rule ID: GH-HRD019
REMEDIATION
In the branch set a linear history.
SaaS:
In the organization setting in the Github site:
- Go to 'Branches'.
- Go to 'Brnach protection rules'.
- Go to 'Protect matching branches'.
- Click on 'Require linear history' (should be marked).
Read more:
- https://docs.github.com/en/github-ae@latest/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule
- https://docs.github.com/en/github-ae@latest/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-linear-history
Updated about 1 year ago