title: Configure git to track only one file extension
body: <p>I have one directory tree with many kind of different files. There are 300 directories on the parent directory. Each directory could have other sub directories.</p>
  
  <p>I only want to track *.cocci on all sub directories. Here is my .gitignore:</p>
  
  <pre><code>*
  !*.cocci
  </code></pre>
  
  <p>But it do not work, as the files on sub directories are not tracked. How can I tell git that I only want to track *.cocci on all sub directories?</p>