DEV Community

Discussion on: Please remove that .git folder

Collapse
 
darkain profile image
Vincent Milum Jr

A better strategy: don't put sensitive credentials in your git repos to begin with.

The .htaccess recommendation is limited in what servers even support that directive. There are methods to do it with others, but this becomes a separate security nightmare of making sure infrastructure never changes over time (which is within itself a different bad practice)

Security credentials should be stored using a dedicated secrets manager outside of the repo. This is especially true because dev/staging/test/prod/etc should all have separate credentials ANYWAYS, so mish-mashing them all together in the repo with conditions isn't best practices to begin with.

Collapse
 
ytjchan profile image
ytjchan

Some info can be stored in .git folder such as commit user name and email using git config, which defaults to storing them into .git/config.

Some comments have been hidden by the post's author - find out more