title: Whitelisting and subdirectories in Git
body: <p>I have created a white-list for text files only.</p>
  
  <pre><code>*
  !*.txt
  </code></pre>
  
  <p>Now, I have an untracked text file in a sub-directory - <code>sub/dir/file.txt</code>, and this is NOT shown (it is ignored). Text files in the root directory are shown, however.</p>
  
  <p>Why is that, and how do I fix it?</p>