From bf3857c04c6e2c07c76813475edf8682c98536a0 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 20 Jul 2024 05:14:34 -0700 Subject: [PATCH] Fix cleanup instructions on removing sensitive content site (#51690) Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com> --- .../removing-sensitive-data-from-a-repository.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 901a400ce88b..c05f32d333f3 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 @@ -188,10 +188,11 @@ After using either the BFG tool or `git filter-repo` to remove the sensitive dat 1. Tell your collaborators to [rebase](https://git-scm.com/book/en/Git-Branching-Rebasing), _not_ merge, any branches they created off of your old (tainted) repository history. One merge commit could reintroduce some or all of the tainted history that you just went to the trouble of purging. -1. After some time has passed and you're confident that the BFG tool / `git filter-repo` had no unintended side effects, you can force all objects in your local repository to be dereferenced and garbage collected with the following commands (using Git 1.8.5 or newer): +1. If you used `git filter-repo`, you can skip this step. + + If you used the BFG tool, after rewriting, you can clean up references in your local repository to the old history to be dereferenced and garbage collected with the following commands (using Git 1.8.5 or newer): ```shell - $ git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin $ git reflog expire --expire=now --all $ git gc --prune=now > Counting objects: 2437, done.