title: How to setup a git driver to ignore a folder on merge
body: <p>I've already did an extensive search, read a lot of SO questions and solutions and tried it different ways, but I've been unable to do what I want, which is fairly simple.</p>
  
  <p>I have the master branch, where all the main code resides, and the design branch, where the layout of the rails application is built by the design team. They have added a folder called "photoshop" to the public folder to keep their sources for the images also under version control. But I don't want this folder to be copied on merge to the master branch because, well, it is not needed. </p>
  
  <p>Apparently, the way to do this is through a merge driver. So, I've created the "ignore" driver:</p>
  
  <pre><code>[merge "ignore"]
  name = always ignore during merge
  driver = ignore.sh %0 %A %B
  </code></pre>
  
  <p>And created the ignore.sh file on my $PATH:</p>
  
  <pre><code>exit 0
  </code></pre>
  
  <p>I've created the .gitattributes file inside public/, because the photoshop folder should be ignored in whole and it is going to appear under public/:</p>
  
  <pre><code>photoshop  merge=ignore
  photoshop/ merge=ignore
  photoshop/* merge=ignore
  photoshop/**/* merge=ignore
  </code></pre>
  
  <p>As you can see, I've tried several different patterns to ignoring the whole folder, but it does not work. I believe this is because there is no folder on the master branch, so there's no conflict and so git doesn't use the ignore driver. Is there a way to achieve this without having to create a public/photoshop folder on master?</p>
  
  <p>Thanks!</p>