The problem :
We are working in a team of 10 developers, we are building an API, we are using a lot of environment variables which varies from access keys to apis keys. As you know those variables are not gitable.
Each one has a .env file in his local laptop and we are sharing a global sample.env which is also on our Github.
Sometimes a dev may update his .env file and change his environment variables while working on a feature and forget to update the sample.env file or update the team with the new environment variable.
This leads to some frustrating and useless bug when the other developer is testing the feature. Sometimes you end spending 1 hour on a bug and then discover that it was due to outdated environment variables.
How do you keep the .env file secret but synchronized within the team so that each time we update the environment variable it's updated for every member of the team?
I was thinking about a secret gist file with auto-update when the .env file is updated by any team member.
How do you handle this scenario in your team?