I've committed and pushed a large folder a long time ago into my repository. As a result, I have a very large pack file (which contains the repository's history).
I'd like to remove that folder from the repository's history as if it were in the .gitignore
in the first place. I'd like to do that without having to delete it from my local copy.
I've found similar questions to this one but having tried one of the answers (on a not very important, and small, file) it deletes the file/directory from my local copy, which is not good for my case.
Here are the command I tried:
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch unwanted_folder' --prune-empty
git gc --aggressive --prune
Thanks in advance.