title: gitignore and how to ignore a common directory name and its contents
body: <p>I've been pulling out my hair researching the net and various docs about .gitignore files. I'm a bit of a n00b with Unix/Terminal (using Mac OS X) and I can't for the life of me figure out how to ignore a folder's contents (any kind of content, be it a file or another folder, no matter how deep it is).</p>
  
  <p>I'm working on a project that generates image files within a consistent file structure, except we're getting merge conflicts regarding user permissions. I'd like to ignore the folders that contain the generated images so we can avoid any further hair-pulling having to adjust permissions on a per-pull basis. I'm just having trouble getting the .gitignore file to work, so I need to figure out the right pattern for folder's content matching. I want it to be general enough in that it can easily encompass the whole site (so if any folder contains a particular folder name, it will ignore its contents).</p>
  
  <p>I've tried:</p>
  
  <pre><code># Images
  resample/
  resize/
  min/
  </code></pre>
  
  <p>And...</p>
  
  <pre><code># Images
  resample/*
  resize/*
  min/*
  </code></pre>
  
  <p>And...</p>
  
  <pre><code># Images
  */resample/*
  */resize/*
  */min/*
  </code></pre>
  
  <p>And many more combinations with unsatisfactory results. I never got the <code>foldername/**/*</code> pattern to ever work either. Any help regarding this issue would be most appreciated!</p>