I just needed to post an answer so everyone will know it and also to save it for my future mistakes.
If anyone here knows better solution / tips / advices on this, please, elaborate! :)
I just needed to post an answer so everyone will know it and also to save it for my future mistakes.
If anyone here knows better solution / tips / advices on this, please, elaborate! :)
Easy thing - you wont need to cut out commits, just do:
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD
It will delete all the file occurrences in history. You can mention $files
as single file or as bunch of them.
Note that it will create backup, so you will need to use this command with -f
option in case when you need to run it more than one time.
man: git-filter-branch(1) Manual Page
the idea belongs to The Nuclear Option: filter-branch