How would you go about setting up this scenario in git:
My source has a settings file with configuration settings such as db connection credentials, etc... (this is a Drupal source and I'm referring to settings.php)
When developers clone the source, they'll need to go in and change settings specific to their environment. These changes of course should not be pushed back to origin. And at the same time I want them to be able to work with this default template (since most of it will not be changed).
So .gitignore doesn't work here because I want it in their first clone.
Do I need to teach every new developer about git update-index --assume-unchanged
?
Isn't there a slicker way to do this?
Git ignore patterns An asterisk is a wildcard that matches zero or more characters. Prepending an exclamation mark to a pattern negates it. If a file matches a pattern, but also matches a negating pattern defined later in the file, it will not be ignored.
The . gitignore file tells Git which files to ignore when committing your project to the GitHub repository. gitignore is located in the root directory of your repo. / will ignore directories with the name.
I would rename database.php
to database.php.sample
and add database.php
to .gitignore
.
Whenever a new user comes up, just copy from database.php.sample
to database.php
and make the appropriate changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With