Push Protection for Private Repos #197712
-
🏷️ Discussion TypeQuestion 💬 Feature/Topic AreaSecret scanning Discussion DetailsI am inquiring about the availability of push protection for private repositories. I followed the steps outlined in the GitHub documentation (https://docs.github.com/en/code-security/how-tos/secure-your-secrets/prevent-future-leaks/enabling-push-protection-for-your-repository), but I do not see the option to enable push protection in the settings for my private repositories; it only appears for public repositories. |
Beta Was this translation helpful? Give feedback.
Answered by
Sahil-Mansuri-15
Jun 2, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
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 → EnableThen enable…