title: .gitignore whitelist on directory and its contents
body: <p>I'm trying to whitelist the directory (and its contents) SupplierName in my Zend Framework 2 vendor directory.</p>
  
  <p>The original .gitignore file in /vendor looks like this:</p>
  
  <pre><code># Add here the vendor path to be whitelisted
  # Ex: for composer directory write here "!composer" (without quotes)
  !.gitignore
  *
  </code></pre>
  
  <p>Now I'd like to whitelist the directory  SupplierName  which shouldn't be too hard I thought. I have <a href="https://www.kernel.org/pub/software/scm/git/docs/gitignore.html">read the docs on gitignore</a> and tried the following configurations:</p>
  
  <p><strong>First try</strong>, add !SupplierName right after the comment which says that I have to add the whitelisted path here.</p>
  
  <pre><code># Add here the vendor path to be whitelisted
  !SupplierName
  # Ex: for composer directory write here "!composer" (without quotes)
  !.gitignore
  *
  </code></pre>
  
  <p>Right after that I executed <code>git status</code> which didn't show the vendor/SupplierName directory. <code>git add vendor/SupplierName</code> showed the following message: </p>
  
  <blockquote>
    <p>The following paths are ignored by one of your .gitignore files: vendor/SupplierName</p>
  </blockquote>
  
  <p><strong>Second try</strong></p>
  
  <pre><code># Add here the vendor path to be whitelisted
  # Ex: for composer directory write here "!composer" (without quotes)
  !SupplierName
  !.gitignore
  *
  </code></pre>
  
  <p>Right after that I executed <code>git status</code> which didn't show the vendor/SupplierName directory. <code>git add vendor/SupplierName</code> showed the following message: </p>
  
  <blockquote>
    <p>The following paths are ignored by one of your .gitignore files: vendor/SupplierName</p>
  </blockquote>
  
  <p><strong>Third try</strong></p>
  
  <pre><code># Add here the vendor path to be whitelisted
  # Ex: for composer directory write here "!composer" (without quotes)
  !.gitignore
  *
  !SupplierName
  </code></pre>
  
  <p>Right after that I executed <code>git status</code> which didn't show the vendor/SupplierName directory. <code>git add vendor/SupplierName</code> <strong>seems to work</strong>. But now, when I want to add the Module.php file (and some other files, subdirectories, etc) the following happens. <code>git add vendor/SupplierName/Module.php</code> --> </p>
  
  <blockquote>
    <p>The following paths are ignored by one of your .gitignore files: vendor/SupplierName/Module.php</p>
  </blockquote>
  
  <pre><code># Add here the vendor path to be whitelisted
  # Ex: for composer directory write here "!composer" (without quotes)
  *
  !.gitignore
  !SupplierName
  !SupplierName/
  !SupplierName/*
  </code></pre>
  
  <p>Allows me to add files directly in vendor/SupplierName, but <code>git add vendor/SupplierName/config/module.config.php</code> still results in </p>
  
  <blockquote>
    <p>The following paths are ignored by one of your .gitignore files: vendor/SupplierName/config/module.config.php</p>
  </blockquote>
  
  <p>I've been searching for problems regarding recursive whitelisting, because that seems to be the problem, but nothing came up.</p>