It is not clear what file types you are talking about.
In the case of configuration files, I always recommend the following approach:
- Commit an example configuration file with normal defaults, for example.
config.sample.ini . - Ignore the file without a sample, for example.
config.ini . - As part of the βrunβ procedure on new machines, the
config.sample.ini file must be copied to config.ini and configured. Document this process in your README, or wiki, or anywhere. - Make sure your code is "not working properly" if there is no configuration file, for example. When starting the software, an error will immediately occur: "Could not find config.ini. Have you copied the sample file?"
This ensures that the sample file can be easily updated. This ensures that the configuration file is not executed. He quickly copes if he is mistaken. And it's relatively simple to implement.
The fastest way to get from a dedicated config.ini ignored config.ini and a committed config.sample.ini is likely to do something like
git mv config.ini config.sample.ini echo config.ini >> .gitignore git commit -a -m "Replace config file with sample config file"
Update:
Your wiki example is interesting.
You are right that a deep tree of .sample files would be difficult to manage, but you can get the same effect with a zip file or archive:
- Create an archive that will be tied to a repository containing your basic wiki content, for example.
wiki.zip . - Ignore the directory where the wiki will be extracted, for example.
path/to/wiki-root . - Add "extract wiki with
unzip -d path/to/wiki-root " to your documentation. This is now part of your installation / deployment procedure.
Now you can update the zip file as needed and commit these changes, ignoring the changes in the extracted files.
Chris source share