Last active
January 29, 2023 16:53
-
-
Save brokenmold/994d58ccb4160e63ffa3f3a05ce383a5 to your computer and use it in GitHub Desktop.
Wipe oops'd .env's from GitHub
This file contains hidden or 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
*** Removes most recent unpushed env commit & adds env to gitignore *** | |
echo '.env' >> .gitignore | |
git rm -r --cached .env | |
git add .gitignore | |
git commit -m 'untracking .env' | |
git push origin master | |
*** Removes all env instances from commit history *** | |
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD | |
git push --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment