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:

  1. Go to 'Branches'.
  2. Go to 'Brnach protection rules'.
  3. Go to 'Protect matching branches'.
  4. Click on 'Require linear history' (should be marked).

Read more: