How to permanently delete a file stored in GIT (both from the local and remote repositories)?
First run
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all
Then shrink the .git folder
rm -rf .git/refs/original/ git reflog expire --expire=now --all git gc --prune=now git gc --aggressive --prune=now
Now push all the changes to the remote repository
git push --all --force
**Acknowledgement to https://stackoverflow.com/a/24526351