BFG Repo cleaner - how to remove the secrets history from tags

528 Views Asked by At

I am following the steps from below link to remove the secrets from git history.

https://rtyley.github.io/bfg-repo-cleaner/

But the history is not getting removed from the tags. Could you please help on how to remove the history from tags?

1

There are 1 best solutions below

0
dbaltor On

You must start cloning the repo with --mirror, this way git will clone all refs, including branches and tags. Then you run the tool to clean all refs out. When you push, all cleaned refs are going to be pushed back.

As per the documentation:

First clone a fresh copy of your repo, using the --mirror flag:

$ git clone --mirror git://example.com/some-big-repo.git

This is a bare repo, which means your normal files won't be visible, but it is a full copy of the Git database of your repository, and at this point you should make a backup of it to ensure you don't lose anything.