Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="https://github.com/git/git/commit/59856de171397c355923ee6cd6debae89385c824">Commit 59856de</a> from <a href="https://github.com/kblees">Karsten Blees (kblees)</a> for Git 1.9/2.0 (Q1 2014) clarifies that case:</p> <h2><a href="https://github.com/git/git/blob/59856de171397c355923ee6cd6debae89385c824/Documentation/gitignore.txt"><code>gitignore.txt</code></a>: clarify recursive nature of excluded directories</h2> <blockquote> <p>An optional prefix "<code>!</code>" which negates the pattern; any matching file excluded by a previous pattern will become included again. </p> <p><strong>It is not possible to re-include a file if a parent directory of that file is excluded. (<code>*</code>)<br> (<code>*</code>: unless certain conditions are met in git 2.8+, see below)<br> Git doesn't list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.</strong></p> <p>Put a backslash ("<code>\</code>") in front of the first "<code>!</code>" for patterns that begin with a literal "<code>!</code>", for example, "<code>\!important!.txt</code>".</p> <p>Example to exclude everything except a specific directory <code>foo/bar</code> (note the <code>/*</code> - without the slash, the wildcard would also exclude everything within <code>foo/bar</code>):</p> </blockquote> <pre><code> -------------------------------------------------------------- $ cat .gitignore # exclude everything except directory foo/bar /* !/foo /foo/* !/foo/bar -------------------------------------------------------------- </code></pre> <hr> <p>Update Feb/March 2016:</p> <p>Note that with git 2.9.x/2.10 (mid 2016?), it might be possible to re-include a file if a parent directory of that file is excluded <a href="https://github.com/git/git/commit/d589a67eceacd1cc171bbe94906ca7c9a0edd8c5#diff-7fea460d44f92f185e7add8aa5620305R144">if there is no wildcard in the path re-included</a>.</p> <p><a href="https://github.com/pclouds">Nguyễn Thái Ngọc Duy (<code>pclouds</code>)</a> is trying to add this feature:</p> <ul> <li><a href="https://github.com/git/git/commit/506d8f1b394917c345965fc1762afa66678870c1">commit 506d8f1</a> for git v2.7.0, reverted in <a href="https://github.com/git/git/commit/76b620d8166bf4cc7cadbc61f9927799ceea9162">commit 76b620d</a> git v2.8.0-rc0</li> <li><a href="https://github.com/git/git/commit/5e57f9c3dfe7dd44a1b56bb5b3327d7a1356ec7c">commit 5e57f9c</a> git v2.8.0-rc0,... reverted(!) in <a href="https://github.com/git/git/commit/5cee349370bd2dce48d0d653ab4ce99bb79a3415">commit 5cee3493</a> git 2.8.0.</li> </ul> <p>So with git 2.9+, this could have actually worked, but was ultimately reverted:</p> <pre><code>application/ !application/language/gr/ </code></pre>
    singulars
    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.
    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