Completely Remove Secret File from Git History (.env)

PHOTO EMBED

Wed Feb 02 2022 21:43:42 GMT+0000 (Coordinated Universal Time)

Saved by @jimbrig #git

git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD
 
git push --force
content_copyCOPY

Assuming the file is `.env` in this circumstance.

https://h.daily-dev-tips.com/removing-a-env-file-from-git-history