Git Newbie here,
How do I remove all traces of a file from my Git commits - e.g. delete it everywhere in every branch, both locally and remote.
Most of the articles and Stack Overflow stuff I've seen states that some variation of this is the way to go:
git filter-branch --tree-filter 'rm -f file_to_remove.py' HEAD
or
git filter-branch --tree-filter 'rm -f file_to_remove.py' ..HEAD
or
git filter-branch --force --tree-filter 'rm -f file_to_remove.py' -- --all
etc...
But, I can't seem to get any to work.
For one, I keep getting an error like this one or another similar error for other branches.
WARNING: Ref 'refs/remotes/origin/master' is unchanged"
I ran the last one and it went through all the revisions and "looked" like it was doing something, but then I executed....
git show <<REVISION_HASH_NUM>>:file_to_remove.py
Which shows that the file is still present in the commit history. Likewise, my Git commit history for that file is still present it TFS.
Also, there are 247 commits and 16+ other developers that use this repo. I can't nuke the Master branch.
P.S. Please don't refer me other Stack Overflow posts. I've already looked at the majority of them. Also, please don't say to rephrase my question. If I knew enough to ask the question correctly, then I'd know enough to fix it myself.
Thanks in advance!