Migrate and secure (quickly) old private repos for public archiving

By Ryan Romanchuk
On

Discover any potential sensitive data with gittyleaks

Modify your branch normally, removing any files or replacing strings you don't want archived. Commit & push as normal.

touch strip.txt && echo "strip.txt" >> .gitignore and add any strings that should be wiped, separated by newlines

Now rewrite history

bfg --replace-text strip.txt --delete-folders node_modules --delete-files oops.yml
git reflog expire --expire=now --all && git gc --prune=now --aggressive

We're archiving, so yes, --force

git push --force
talk