Last active
August 29, 2023 20:40
-
-
Save carl0zen/d6e6f629d1bea1378c613da71f0c2667 to your computer and use it in GitHub Desktop.
Remove .env from commit history
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
// Add to .gitignore | |
printf "\n.env*" >> .gitignore | |
// Run this command | |
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD | |
// Force push | |
git push --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment