Skip to content

Instantly share code, notes, and snippets.

@gjerokrsteski
Last active July 11, 2024 08:40
Show Gist options
  • Save gjerokrsteski/e4a10352448158ba827493eb116cda51 to your computer and use it in GitHub Desktop.
Save gjerokrsteski/e4a10352448158ba827493eb116cda51 to your computer and use it in GitHub Desktop.
remove env file from git history forever
echo '.env' >> .gitignore
git rm -r --cached .env
git add .gitignore
git commit -m 'untracking .env'
git push origin master
@PranotiPD
Copy link

It did work thank you!

@169398
Copy link

169398 commented Jul 2, 2024

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch application/.env.example' --prune-empty --tag-name-filter cat -- --all

@169398
Copy link

169398 commented Jul 2, 2024

It really worked thank you

@delabi
Copy link

delabi commented Jul 11, 2024

Perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment