Created
February 23, 2023 06:55
-
-
Save dogterbox/26eb544140490d0cc5f0d152804f8541 to your computer and use it in GitHub Desktop.
Cleanup files with git-filter-repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# upgrade git | |
sudo apt-get install -y python-software-properties software-properties-common | |
sudo add-apt-repository ppa:git-core/ppa -y | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install git -y | |
# install git-filter-repo | |
pip3 install git-filter-repo | |
# cleanup files | |
# --invert-paths is remove dir | |
git filter-repo --path <file-or-dir> --invert-paths --force | |
# push to remote | |
git remote add origin <remote-url> | |
git push --set-upstream origin <branch-name> --force |
after running git filter-repo ...
when check git status
you see nothing to commit or change
don't worry, pls next step (pushing...)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://improveandrepeat.com/2021/06/how-to-use-git-filter-repo-to-remove-files-from-your-git-repository/