Last active
January 5, 2025 11:01
-
-
Save gjerokrsteski/e4a10352448158ba827493eb116cda51 to your computer and use it in GitHub Desktop.
remove env file from git history forever
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo '.env' >> .gitignore | |
git rm -r --cached .env | |
git add .gitignore | |
git commit -m 'untracking .env' | |
git push origin master |
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD git push --force
I just run this and ended up with this error in my CI Pipeline
fatal: empty ident name
. Anyway to go about it?
this work for me. thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm blown away by the response to this Gist! Thanks so much to everyone who has starred and forked this repo. Your support means the world to me. If you have any questions or suggestions, please don't hesitate to reach out. PEACE!