title: How can I write a rule in gitignore to ignore all files except directories in some directory?
body: <p>So lets say I have a directory structure like so</p>
  
  <pre><code>uploads/
  --dir1/
  ----one.txt
  ----two.txt
  ----dir2/
  ------one.txt
  ------two.txt
  </code></pre>
  
  <p>I would like any directory and sub directories of uploads to be tracked but not any files in it with the exception of a dummy file because git doesn't track directories.  </p>
  
  <p>I would think something like this would work but it doesn't.</p>
  
  <pre><code>*
  !.gitignore
  </code></pre>