Skip to content
Discussion options

You must be logged in to vote

Push protection for private repositories requires GitHub Advanced Security (GHAS) to be enabled. This is why the option is not visible in your private repo settings — it is a paid feature for private repos, while public repos get it for free.

How to enable it for private repos:

Step 1 — Check your plan:
Push protection on private repos is available on:

  • GitHub Enterprise Cloud
  • GitHub Enterprise Server
  • GitHub Team or Free orgs with GHAS add-on purchased

If you are on a personal free/pro plan, push protection is only available for public repositories.

Step 2 — If you have GHAS, enable it at org level first:
Go to: Org Settings → Code Security → GitHub Advanced Security → Enable

Then enable…

Replies: 1 comment

This comment was marked as low quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Secret Scanning Detect and prevent the exposure of sensitive information in your code Code Security Build security into your GitHub workflow with features to keep your codebase secure Question Ask and answer questions about GitHub features and usage Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
2 participants