Anyone with admin permissions to a repository can require a linear commit history.
About enforcement of linear commit history
Enforcing a linear commit history prevents merge commits from being pushed to the protected branch. This means that any pull requests merged into the protected branch must use a squash merge or a rebase merge. A strictly linear commit history can help teams backtrack changes more efficiently. For more information about merge methods, see "About pull request merges."
You can automatically enforce protected branch settings for some or all branches in your repository. For more information, see "Configuring protected branches."
Before you can require a linear commit history, your repository must allow squash merging or rebase merging. For more information, see "Configuring pull request merges."
Enforcing a linear commit history
- On GitHub, navigate to the main page of the repository.
- Under your repository name, click
Settings.

- In the left menu, click Branches.

- Next to "Branch protection rules", click Add rule.

- Under "Branch name pattern", type the branch name or pattern you want to protect.

- Under "Protect matching branches", select Require linear history.

- Optionally, select Include administrators. This enforces all configured restrictions for repository administrators.

- Click Create.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
