Skip to content

Git

Removing sensitive files

Requires BFG Repo-Cleaner to be installed.

To remove the sensitive file, leaving the latest commit untouched (the file will be added in the current state as part of the latest commit):

bfg --delete-files <file-to-be-removed>
git push --force

Cleanup

Expire all unreachable content and pack the repo in the most compact way.

git gc --aggressive --prune=now

Clear the reflog.

git reflog expire --expire=now --all