From b5e1d508125eaaaf6e9360bb79dda14ea88bdb24 Mon Sep 17 00:00:00 2001 From: "Dina Berry (MSFT)" Date: Fri, 22 Mar 2024 11:42:29 -0700 Subject: [PATCH] Update removing-sensitive-data-from-a-repository.md (#31760) Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../removing-sensitive-data-from-a-repository.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md b/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md index 3708f276c234..a1ef0cfdd7f5 100644 --- a/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md +++ b/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md @@ -216,6 +216,7 @@ There are a few simple tricks to avoid committing things you don't want committe - Avoid the catch-all commands `git add .` and `git commit -a` on the command lineā€”use `git add filename` and `git rm filename` to individually stage files, instead. - Use `git add --interactive` to individually review and stage changes within each file. - Use `git diff --cached` to review the changes that you have staged for commit. This is the exact diff that `git commit` will produce as long as you don't use the `-a` flag. +- Enable push protection for your repository to detect and prevent pushes which contain hardcoded secrets from being committed to your codebase. For more information, see "[AUTOTITLE](/code-security/secret-scanning/push-protection-for-repositories-and-organizations#about-push-protection-for-repositories-and-organizations)." ## Further reading