roots / bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure
https://roots.io/bedrock/
MIT License
6.15k stars 1.16k forks source link

[Feat] Also ignore env files not starting with `.env` #707

Closed hirasso closed 7 months ago

hirasso commented 7 months ago

Summary

Hi there, I hope it's ok to open another issue right away.

In Bedrock's .gitignore, would you be open to add a line to also ignore files ending with .env? I think one line more wouldn't hurt to make sure no credentials make it into repos unnoticed.

 # Dotenv
 .env
 .env.*
+*.env
 !.env.example

Additional context

I'm in the process of developing wp-sync-deploy, a tool to deploy and sync WordPress sites between environments. Right now, I've installed Bedrock to see how it goes with it's custom folder structure.

My tool makes use of a file wp-sync-deploy.env for configuration. I was unsure if I should call it .env.wp-sync-deploy instead, but ChatGPT said it didn't matter and was a matter of personal preference 😅

retlehs commented 7 months ago

That section of the gitignore is specifically for Dotenv files

Theres folks using files that end in .env that are committed to the repo on occasion. For example, I've come across several Lando setups that ship with a .lando.env file that is committed to the repo. This is something we do in Radicle as well.

hirasso commented 7 months ago

oh.. ok. Then I need to change wp-sync-deploy to follow that convention. Thanks for the quick response!