title: Git-ignore certain files in sub-directories, but not all
body: <p>I have a structure similar to the following: </p>
  
  <pre><code>/root/
  /root/data/
  /root/data/script.php
  /root/data/some.json
  /root/data/feature/one.json
  /root/data/feature/two.json
  /root/data/other-feature/one.json
  /root/data/other-feature/important-script.php
  </code></pre>
  
  <p>I'd like git to ignore <em>any</em> <code>.json</code> files under the '/data/...' path, but '/data/' sometimes contains sub-directories. </p>
  
  <p>My understanding is that a simple <code>data/*.json</code> in gitignore will only match one directory, as the <code>*</code> doesn't match <code>/</code>, as stated at <a href="http://git-scm.com/docs/gitignore" rel="noreferrer">http://git-scm.com/docs/gitignore</a>, "Pattern Format", bullet #6: </p>
  
  <blockquote>
    <p>Otherwise, git treats the pattern as a shell glob suitable for consumption by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will not match a / in the pathname. For example, "Documentation/*.html" matches "Documentation/git.html" but not "Documentation/ppc/ppc.html" or "tools/perf/Documentation/perf.html".</p>
  </blockquote>
  
  <p>Is there a simple way to do this, or do I need to actively add gitignore files in each sub-directory, explicitly?</p>