stevset/note/git_purge_file.txt
2024-05-06 21:44:11 -04:00

5 lines
254 B
Text
Executable file

sometimes you need to get rid of a file from all past commits in git. to do that do the following:
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.PATTERN'
then force an update to the remote by
git push --force -u origin master