.env file not gitignored. I had someone do it manually for me once

404 Views Asked by At

So im currently working on a project and my my .env file is not greyed out (gitignore?). Trying to figure out what I need to do globally because I do have the file but my .env is never greyed out. Any suggestions? I can provide screenshots if needed.

I had someone do a a few commands in the terminal and was able to get my .env to go grey once. But I believe he told me he wasn't able to do it globally.

Reach out for help.

1

There are 1 best solutions below

5
VonC On

First, make sure your .env is not already tracked (or any amount of .gitignore or core.excludesFile would not change anything)

cd /apth/to/.env
git rm --cached .env

Then check if it is currently ignored with:

git check-ignore -v -- .env