Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As Git doesn't support this out of the box, you may implement one yourself with Git hooks, for example:</p> <p>In any case, you will need to manage your ignores and includes in a custom file, not a <code>.gitignore</code> itself, as this one will be generated. So, let's say, you have a <code>.gitignoreincludes</code> file in a branch, and custom include files in other branches. </p> <p>So, you may install a "post-merge" hook like this, for example:</p> <pre><code>#!/bin/bash gitignoreWithIncludes=".gitignoreincludes" if [[ -f $gitignoreWithIncludes ]]; then echo ".gitignore" &gt; .gitignore while read -r line do if [[ $line == include* ]]; then includeName=${line:8} while read -r includeLine do echo $includeLine &gt;&gt; .gitignore done &lt; $includeName else echo $line &gt;&gt; .gitignore fi done &lt; $gitignoreWithIncludes fi </code></pre> <p>This hook will launch on any <em>successful</em> merge, will look for a <code>.gitignoreincludes</code> file, and, if it exists, will generate a <code>.gitignore</code> file. <code>.gitignore</code> will contain all entries from <code>.gitignoreincludes</code> and all entries from all files referenced as <code>include FILE_NAME</code>. Having <code>.gitignore</code> ignoring itself allows it to be safely regenerated multiple times when doing merges.</p> <p>This can be further improved by allowing <code>include</code> instructions in included files as well, or also a <code>post-checkout</code> hook can be implemented to regenerate the .gitignore when switching between branches, etc., etc.. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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