In my dev team, we have multiple projects spanned across several git repos. Those projects actually share a few common config elements. We have recently made a local change to one of our shared config files that none of us wish to commit to the production environment.
/www/
|
|-- git repo 1 (containing shared config files)
|-- git repo 2 uses files from 1
|-- git repo 3 uses files from 1
|-- git repo n uses files from 1
While we were setting up a .gitignore file for each repo, I came across ~/.gitignore_global
Since .gitignore_global is in ~/, its per user, right?
Should I have each developer implement their own .gitignore_global file, or can I apply the regular .gitignore to all of them so it can be committed globally?
That supposes you define, as mentioned in
gitignoreman page, the propertycore.excludesfile:So yes, it is per user.
That being said, for configuration files with variable content (depending on the environment), I would rather prefer version in the repository a
.gitattributesfile with a content filter driver in it.See forinstance “How to keep different content of one file in my local and github repository?“
zerocog mentions in the comments the tutorial yakiloo.com.