How do I remove all of a certain type of file from the Repository? I'm using
git filter-branch --index-filter 'git rm -rf --cached **/*.jar'
Either git is not expanding globs, or it isn't expanding **
in the way I'm expecting.
The easiest way I've found is to use the BFG Repo-Cleaner
The instructions on the project page are clear. The command you would use is something like:
bfg --delete-files "*.jar" my-repo.git
BFG will clean the history of the repo of all files ending in the .jar extension. You can then inspect the result before pushing it back to the server.
You simply have to run this in order to remove all your jars from the index:
git rm -r --cached **/*.jar
Run this command from your root directory of the project and it will clean up and will remove all your file only from the staging area.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With