Skip to main content

Push protection for users

With push protection for users, you are automatically protected on all pushes to public repositories across GitHub Enterprise Cloud.

Who can use this feature?

Push protection for users is on by default and can be disabled in your personal account settings.

About push protection for users

Push protection for users automatically protects you from accidentally committing secrets to public repositories across GitHub Enterprise Cloud.

When you try to push a secret to a public repository, GitHub blocks the push. If you believe it's safe to allow the secret, you have the option to bypass the block. Otherwise, you must remove the secret from the commit before pushing again. For more information on how to resolve a blocked push, see "Pushing a branch blocked by push protection."

Push protection for users is always on by default. You can disable the feature at any time through your personal account settings. This may cause secrets to be accidentally leaked. For more information, see "Disabling push protection for users."

Push protection for users is different from push protection for repositories and organizations, which is a secret scanning feature that must be enabled by a repository administrator or organization owner. With push protection for repositories and organizations, secret scanning blocks contributors from pushing secrets to a repository and generates an alert whenever a contributor bypasses the protection. For more information, see "Push protection for repositories and organizations."

With push protection for users, GitHub won't create an alert when you bypass the protection and push a secret to a public repository, unless the repository itself has secret scanning enabled. However, if the bypassed secret is a GitHub token, the token will be revoked and you will be notified by email.

For information on the secrets and service providers supported for push protection, see "Secret scanning patterns."

Disabling push protection for users

You can disable push protection for users through your personal account settings.

  1. In the upper-right corner of any page, click your profile photo, then click Settings.

    Screenshot of a user's account menu on GitHub. The menu item "Settings" is outlined in dark orange.

  2. In the "Security" section of the sidebar, click Code security and analysis.

  3. Under "User", to the right of "Push protection for yourself", click Disable.

    Screenshot of the "User" section of the "Code security and analysis" settings page. A button labeled "Disable" is outlined in dark orange.