title: Difference between ** and * in glob matching (.gitignore)
body: <p>I have the following directory structure and files.</p>
  
  <pre><code>pw-spec/
  |-- event_spec.coffee
  |-- event_spec.js
  |-- integration
  |   `-- service
  |       |-- auth_spec.coffee
  |       |-- auth_spec.js
  |       |-- chat_spec.coffee
  |       |-- chat_spec.js
  |       |-- transport_spec.coffee
  |       `-- transport_spec.js
  |-- message_spec.coffee
  |-- message_spec.js
  |-- pw_spec.coffee
  |-- pw_spec.js
  |-- run.coffee
  |-- run.html
  |-- run.js
  |-- service
  |   |-- auth_spec.coffee
  |   |-- auth_spec.js
  |   |-- chat_spec.coffee
  |   |-- chat_spec.js
  |   |-- stream_spec.coffee
  |   `-- stream_spec.js
  |-- spec.coffee
  |-- spec.js
  `-- stub
      |-- stream.coffee
      |-- stream.js
      |-- transport.coffee
      `-- transport.js
  
  4 directories, 27 files
  </code></pre>
  
  <p>I would like to ignore all <code>*.js</code> files anywhere within <code>pw-spec</code> directory.</p>
  
  <p>However, adding the following patterns to <code>.gitignore</code> doesn't cut it:</p>
  
  <pre><code>pw-spec/*.js
  pw-spec/**/*.js
  </code></pre>
  
  <p>The problem is that the second one only matches js files that are exactly 1 level
  deep within the tree, while I want to match all js files under <code>pw-spec</code>.</p>
  
  <p>Doing </p>
  
  <pre><code>ls pw-spec/**/*.js
  </code></pre>
  
  <p>produces [1]:</p>
  
  <pre><code>pw-spec/service/auth_spec.js
  pw-spec/service/chat_spec.js
  pw-spec/service/stream_spec.js
  pw-spec/stub/stream.js
  pw-spec/stub/transport.js
  </code></pre>
  
  <p>As you can see </p>
  
  <pre><code>pw-spec/integration/service/auth_spec.js
  pw-spec/integration/service/chat_spec.js
  pw-spec/integration/service/transport_spec.js
  </code></pre>
  
  <p>are missing from [1].</p>