title: gitignore certain file extensions in the branch
body: <p>I am trying to get gitignore to ignore all <code>*.gz</code> files under a <code>db/</code> folder, but not in other folders. Is there a way to do that with the .gitignore in the project root?</p>
  
  <p><strong>.gitignore</strong></p>
  
  <pre><code>db/*.gz    # ignores db/a.gz, but not db/data/b.gz
  db/*/*.gz  # ignores db/data/b.gz, but not db/data/extra/c.gz
  db/**/*.gz # ditto, ignores db/data/b.gz, but not db/data/extra/c.gz
  </code></pre>
  
  <p>I have read man gitignore and looked through the similar questions here on stackoverflow, sorry if this came up earlier.</p>
  
  <hr>
  
  <p>zsh v4.3.17 (x86_64), git v1.7.8.6, gentoo kernel v3.4.9</p>