title: How to ignore files in Git merge?
body: <p>I'm working on a (Django) website with two branches: <code>master</code> and <code>dev</code>.</p>
  
  <p><code>master</code> is the production version and no work should be done here directly. All the changes should come from merging <code>dev</code> branch, once it is considered to be stable.</p>
  
  <p><code>dev</code>, as you may guess, is the development branch and all the changes are made here (and subbranches).</p>
  
  <p>In the server I have two websites working, the production one (uses <code>master</code> branch) and another private for development, with <code>dev</code> subdomain that uses <code>dev</code> branch.</p>
  
  <p>The problem is that all the configuration files, static files (images, etc.) are inside the control version to be able to easily push them to the server. But, if these kind of files (static, config...) are modified in <code>dev</code> to just debug in the server and then I need to merge with master... <strong>How can I set some files and dirs to be ignored when merging dev into master?</strong></p>
  
  <p>I've been searching and I've found some <a href="https://stackoverflow.com/questions/3868491/git-ignore-some-files-during-a-merge-keep-some-files-restricted-to-one-branch">related questions</a>, but they tell you to use <code>.gitattributes</code> with <code>merge=ours</code>. However, this approach has a big caveat: it only applies the strategy if the file is modified in the two branches, but this isn't my case.</p>
  
  <p>Any tips on how should I go on?</p>