This is my file directory structure
project
- client
- server (has the .env file with credentials)
How can I hide credentials in the .env file when I push to github? I know that you have to use .gitignore but how would that work since my .env is not in the root directory?
UPDATE
I tried doing what the response said but the .env file still did not disappear in my repo.
Here is what the .gitignore file reads:
.env
.idea
**/node_modules
data
yarn.lock

