title: git diff between two branches not matching the changes during a merge
body: <p>I have two branches, master and feature.
  If I do:</p>
  <pre><code>git diff --name-only master..feature
  </code></pre>
  <p>I get a long list of files, some of them source code, so not excluded by .gitignore</p>
  <p>But, when I try to merge feature into master:</p>
  <pre><code>git checkout master
  git merge feature
  </code></pre>
  <p>I get only a single file changed in master during the merge process.</p>
  <p>Why does this happen?</p>
  <p>Another interesting thing is, if I try the reverse and merge master into feature, files that were created in the feature branch are deleted.</p>
  <p>How do I fix this and avoid this issue in the future?</p>