Skip to main content

Push protection from the command line

Understand how GitHub uses push protection to prevent secret leaks from the command line.

누가 이 기능을 사용할 수 있나요?

쓰기 권한이 있는 사용자

Push protection prevents you from accidentally committing secrets to a repository by blocking pushes containing supported secrets.

When you attempt to push a supported secret from the command line to a repository secured by push protection, GitHub will block the push.

You should either:

Up to five detected secrets will be displayed at a time on the command line. If a particular secret has already been detected in the repository and an alert already exists, GitHub will not block that secret.

If you confirm a secret is real and that you intend to fix it later, you should aim to remediate the secret as soon as possible. For example, you might revoke the secret and remove the secret from the repository's commit history. Real secrets that have been exposed must be revoked to avoid unauthorized access. You might consider first rotating the secret before revoking it. For more information, see Removing sensitive data from a repository(리포지토리에서 중요한 데이터 제거).

참고 항목

  • Git 구성이 현재 분기뿐만 아니라 여러 분기에 대한 푸시를 지원하는 경우 푸시되는 추가 및 의도하지 않은 참조로 인해 푸시가 차단될 수 있습니다. 자세한 내용은 Git 문서의 push.default 옵션을 참조하세요.
  • 푸시 시 secret scanning이(가) 시간 초과되면 GitHub은(는) 푸시 후에도 커밋에서 비밀을 검사합니다.