title: How can I set .gitignore to ignore all .jars but not in the expected folder
body: <p>I have a project structure like this:</p>
  
  <pre><code>/proj/a/file.jar
  /proj/a/1/file.jar
  /proj/b/file.jar
  /proj/b/1/file.jar
  /proj/b/2/1/file.jar
  /proj/c/file.jar
  /proj/c/1/file.jar
  /proj/c/2/1/file.jar
  </code></pre>
  
  <p>etc.</p>
  
  <p>I'm trying to ignore all jar files except those in <strong>c</strong> folder and all nested ones. How should I set this in .gitignore?</p>
  
  <pre><code>*.jar
  !c/*.jar
  </code></pre>
  
  <p>doesn't work. This too:</p>
  
  <pre><code>*.jar
  !c/*/*.jar
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>*.jar
  !/proj/c/*/*.jar
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>*.jar
  !/proj/c/**/*.jar
  </code></pre>
  
  <p>Am I miss something?</p>