I have accidently committed files that shouldn't be in the repository. Now I want to remove this files from history. What they have in common is, that they have the file extension *.test.
I tried to apply an index filter but that expects a specific file name.
git filter-branch --force --index-filter 'git rm --chached --ignore-unmatch -r *.test' --prune-empty -- --all
Is it possible to do this for all files in one step without specifying them manually?
It's nearly unbelievable, but I had a typo in my script, but I think I have to escape the asterisk too.
So this script is working for me
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch -r \*.test' --prune-empty -- --all
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