Push protection is a check that blocks a code push when it detects a supported secret, before the code reaches the repository. Instead of finding a leaked credential afterwards, it stops the commit from being accepted and tells the developer what was found.

It matters because prevention is much cheaper than clean-up. A secret that never reaches the repository does not have to be revoked, and the developer is warned at the moment the mistake is made.

It only covers what the system is able to recognize, so a secret in an unusual format may pass through. Developers can often bypass the block with a reason, and the check does not help with credentials leaked in other places, such as chat messages, logs or container images. It is a safety net, not a replacement for keeping credentials out of code.

To use it, turn it on where your platform offers it, decide who may bypass it and how that is reviewed, and treat any bypassed or detected secret as a credential to rotate.