Hello Stack Overflow community,
I'm facing an issue while trying to prevent the upload of my .env file located within the server subfolder of my project directory. I've added the .env entry to the .gitignore file in the main directory of the project, but unfortunately, the file is still being tracked by Git and considered for upload.
Here's the directory structure for reference:
Learning-Management-System (Main Folder)
│
├── server (subfolder)
│ ├── .env
│ └── ...other server files
│
├── client (subfolder)
│ └── ...client files
│
└── .gitignore
I've double-checked the .gitignore file's content, and it does include the .env entry. Here's what my .gitignore file looks like:
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
server/node_modules/
server/.env
server/env
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Is there something I'm missing or doing incorrectly? I'd greatly appreciate any insights or suggestions on how to resolve this issue and make sure the .env file is not tracked by Git.
Thank you in advance for your assistance!