Rewriting your git history, removing files permanently

see this great article at https://blog.gitguardian.com/rewriting-git-history-cheatsheet/

Steps:
1) Install newest git version (as git >= 2.22.0 is required)
For Ubuntu, this PPA provides the latest stable upstream Git version:

add-apt-repository ppa:git-core/ppa
apt update; apt install git

see: https://git-scm.com/download/linux

2) install git-filter-repo
python3 -m pip install --user git-filter-repo

3) Do it – here remove the file
git filter-repo --use-base-name --path [FILENAME] --invert-paths
or edit:
git filter-repo --replace-text ../replacements.txt --force

4) Push
git push --all --force

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.