Skip to content

Instantly share code, notes, and snippets.

@bhatvikrant
Last active October 18, 2021 06:56
Show Gist options
  • Save bhatvikrant/f335eaa3ab44eb02428329f795972aa1 to your computer and use it in GitHub Desktop.
Save bhatvikrant/f335eaa3ab44eb02428329f795972aa1 to your computer and use it in GitHub Desktop.
Remove .env from git history if you have committed environment variables by mistake
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