Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For that particular case, where there is a lot of common files evolving in one branch, and only a few config files specific per environment... we do not store the config file in Git. At all.</p> <p>We do store <strong>template</strong> of said config files, plus all the specific per-environment values, plus a script able to replace the variables in the template files by the correct value (detecting the current platform)</p> <p>That way, we do not need to make a branch only for those files.</p> <hr> <p>Another good way to manage those kind of files (with a platform-specifc content) is through a <strong><a href="http://git-scm.com/docs/gitattributes" rel="nofollow noreferrer">git attribute filter driver</a></strong> (see also <a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes" rel="nofollow noreferrer">Pro Git book</a>).</p> <blockquote> <p>A filter driver consists of a <code>clean</code> command and a <code>smudge</code> command, either of which can be left unspecified.<br> Upon <code>checkout</code>, when the <code>smudge</code> command is specified, the command is fed the blob object from its standard input, and its standard output is used to update the worktree file.<br> Similarly, the <code>clean</code> command is used to convert the contents of worktree file upon check-in.</p> </blockquote> <p>That way, a script (managed with Git) referenced by the smudge can replace all the variables by platform-specific values, while the clean script will restore its content to an untouched config file.</p> <p><img src="https://i.stack.imgur.com/cGvOt.png" alt="http://git-scm.com/figures/18333fig0702-tn.png"></p> <p>The main idea remains: avoid creating branches only for that kind of parallel evolution.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload