A long time ago I committed a rather large folder which isn't really supposed to be in my repository, but I understood that only recently.
I found another question with a similar problem to mine and decided to try the chosen solution:
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch unwanted_folder' --prune-empty
git gc --aggressive --prune
Luckily, I was smart enough to not try this on the folder itself (because it contains very important data), and tried this on a non important small file I had for a long time in my repository. The solution I tried ended up deleting the local copy of the file. Unfortunately I didn't check if it really was deleted from my repository's history because keeping my local copy was a higher priority.
So I backed up my local copy and tried the same process on it. It didn't work, the folder stayed in my history, and also in the .pack
file which is practically the history (please correct me if I'm wrong).
Another potential solution I found was to use the "BFG Repo-Cleaner" tool. So I followed the exact instructions from their website (with my wanted filters of course: --delete-folders media
for that matter), and guess what? It didn't work. Oh and another thing, my total repository size DOUBLED.
I really don't wanna start a new repository so -
please, help.