Ensure force push is disabled for all branches

Framework Reference: A.8.3 (Information Access Restriction) Integration: GitHub – Branch Protection

Why this matters

Disabling force pushes preserves the integrity and auditability of your repository’s commit history.
A force push (git push --force) can overwrite commit history, remove evidence of previous changes, and bypass review or compliance processes.

  • By enforcing this control, you ensure that:
  • All commits remain traceable and auditable
  • Code reviews and history are preserved
  • Accidental or malicious overwrites of branch history are prevented

Without this protection, contributors could rewrite history and potentially remove important review evidence or security fixes.


What this check does

This check verifies that for each protected branch:

  • The “Allow force pushes” option is disabled in the branch protection rule.

If force pushes are allowed for any protected branch, the check will fail or show “Unable to verify.”


How to fix it

From the GitHub Web Console

Go to your repository on GitHub.

  1. Navigate to Settings → Branches.
  2. Under Branch protection rules, click Add rule or edit an existing rule.
  3. Scroll to the Force pushes section.
  4. Ensure Allow force pushes is unchecked.
  5. Click Save changes.

This will prevent anyone (except those explicitly allowed) from force pushing to the protected branch.


Exceptions

  • Admins can bypass this restriction if “Include administrators” is not enabled.
  • GitHub allows force pushes only when explicitly permitted in the protection rule or restricted to specific users or teams.
  • Non-protected branches are not affected by this setting.

Further Resources

Was this article helpful?