# Ensure Enforce Linear Commit History in Version Control

- Source: https://support.icompaas.com/support/solutions/articles/62000235199-ensure-enforce-linear-commit-history-in-version-control
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS GitHub Benchmark v1.0.0](https://support.icompaas.com/support/solutions/62000112695) › [CIS GitHub Benchmark v1.0.0](https://support.icompaas.com/support/solutions/folders/62000169264)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:** **Level 1**

**Description:  
** Require that all commits merged into the main branch follow a linear history without merge commits, typically enforced through rebase or squash merging strategies. This ensures a clean, understandable commit history that simplifies auditing, debugging, and code review processes.

**Rationale**:  
 Maintaining a linear history reduces complexity in the repository’s commit graph, making it easier to trace changes, identify issues, and audit code evolution. It prevents confusing merge commits and helps maintain consistency in the codebase’s version history.

**Impact:  
** **Pros**:

-   Simplifies commit history and improves readability.  
      
    
-   Facilitates easier debugging and audit trails.  
      
    
-   Enhances collaboration with clear change lineage.  
      
    

**Cons**:

-   May require additional developer discipline to rebase branches.  
      
    
-   Could cause conflicts that need resolution during rebasing.  
      
    

**Default value:  
** By default, repositories may allow merge commits, resulting in a non-linear commit history.

**Audit**:  
 Review merge strategies configured in the repository settings. Inspect commit history to ensure merges follow a linear pattern without unnecessary merge commits.

**Remediation**:  
 Configure repository branch protection rules to enforce rebase or squash merges only. Educate developers on linear history best practices and provide guidelines on rebasing workflows.

**References**:

1.  GitHub About Merge Methods: [https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-merge-methods-on-your-repository](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-merge-methods-on-your-repository)
    
2.  Atlassian Git Tutorials - Understanding Merge Strategies: [https://www.atlassian.com/git/tutorials/merging-vs-rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing)
    
3.  CIS Controls v8, Control 6 - Maintenance, Monitoring, and Analysis of Audit Logs: [https://www.cisecurity.org/controls/maintenance-monitoring-and-analysis-of-audit-logs/](https://www.cisecurity.org/controls/maintenance-monitoring-and-analysis-of-audit-logs/)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
