# ​ Ensure Prevent Force Pushes to Protected Branches

- Source: https://support.icompaas.com/support/solutions/articles/62000235202--ensure-prevent-force-pushes-to-protected-branches
- 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:  
** Force pushing code to branches, especially protected or main branches, must be explicitly denied to prevent overwriting commit history or deleting commits. Disallowing force pushes safeguards the integrity and traceability of the codebase.

**Rationale:  
** Disabling force pushes reduces the risk of accidental or malicious loss of code history, prevents tampering with commit logs, and maintains a reliable audit trail. This control helps ensure stable and trustworthy version control management.

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

-   Preserves commit history and audit trails.  
      
    
-   Prevents accidental or intentional loss of code changes.  
      
    
-   Enhances repository stability and integrity.  
      
    
-   Supports compliance with development policies.  
      
    

**Cons:**

-   **Limits emergency fixes requiring rewriting history.  
      
    **
    
-   **Requires alternative approaches for resolving certain conflicts.  
      
    **
    

**Default value:  
** **Many repositories allow force pushes by default, which can risk commit history integrity.**

**Audit:  
** **Review branch protection settings to verify force pushes are disabled. Analyze repository logs for any past force push events.**

**Remediation:  
** **Configure branch protection rules to deny force pushes on critical branches. Educate development teams about the risks of force pushing and proper conflict resolution methods.**

**References****:**

1.  **GitHub About Protected Branches: [https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/about-protected-branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/about-protected-branches)**
    
2.  **GitLab Protected Branches and Force Push: [https://docs.gitlab.com/ee/user/project/protected\_branches.html#prevent-force-push](https://docs.gitlab.com/ee/user/project/protected_branches.html#prevent-force-push)**
    
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.
