rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
11.11k stars 549 forks source link

What is the correct process for cleaning multiple branches and tags with BFG? #268

Closed justindomnitz closed 6 years ago

justindomnitz commented 6 years ago

I'm using BFG to clean secrets (API keys, etc.) from a Github repository. The repository has 5 branches and 16 tags, each tag has 1 associated release. I have about 10 repositories with similar structures that I'll also need to complete this process on once I get comfortable.

Following the recommended process on Github's and BFG's web sites I can successfully remove the secrets from the code history on the local repository. The issue is pushing the changes to the remote server. In order to clean all branches, I have to perform a git push --force on each branch after checking it out, one at a time. git push --force --all does not update all branches with the clean history. Then, in order to clean all tags, I need to delete the remote tag and manually push the cleaned tag to the remote, again one a time. Finally, I have to manually re-associate each tag with the correct release.

Is this the right process? If so, I can do it, but it seems cumbersome and I'm thinking I might be missing something?

Thanks!

rtyley commented 6 years ago

I think you need to read the usage instructions :

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

If you use a mirror clone, all refs (this means branches and tags) are cloned, all refs are cleaned, and when you push, all refs are pushed.

justindomnitz commented 6 years ago

Hi Roberto, Thank you for pointing me to the instructions again. The mistake I was making (where I had originally misunderstood) was that I was attempting to run BFG on a checked out local repository instead of a local clone of the repository. Your tool is working great. Thank you! Justin

javabrett commented 6 years ago

@justindomnitz please close this issue if no problems remain.