-
-
Save gjerokrsteski/e4a10352448158ba827493eb116cda51 to your computer and use it in GitHub Desktop.
echo '.env' >> .gitignore | |
git rm -r --cached .env | |
git add .gitignore | |
git commit -m 'untracking .env' | |
git push origin master |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch application/.env.example' --prune-empty --tag-name-filter cat -- --all
Updated to work across branches
Above works also for history
Thanks, this worked for me
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?
It's really handy!
for me this was the perfect solution! I always ended up modifying the .env between MAC and WIN. Thanks a lot
Only this worked for me because I came across the same issue
https://stackoverflow.com/a/55017549/2508481
Perfect! Thank you so much!
Thank you!
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD git push --force
worked for me, thanks!
Worked perfectly fine for me, Thanks.
This worked! Thanks
Thanks man!
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch application/.env.example' --prune-empty --tag-name-filter cat -- --all
Updated to work across branches
This did work to clear the commits from my history, but when checking the git tree with gitk --all
I see that this moves them off of the main remote, and I can still see the .env commits. How do I clear these? See photo of git tree
It worked for me, thanks!
Thank you, it really helps
It did work thank you!
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch application/.env.example' --prune-empty --tag-name-filter cat -- --all
It really worked thank you
Perfect
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD git push --force
worked for me, thanks!
worked for me too, thanks
This only removes in the most recent unpushed commit not from your whole history