title: Git: Unable to discard changes due to line endings?
body: <p>"Out of the blue" I've started having this issue with a git repository that I have hosted on GitHub.</p>
  
  <p>Whenever I pull a remote branch to my computer (even on the first clone of the repository) an arbitrary (?) set of files appear as "Changes not staged for commit". I am running on Windows 8.1 and using <a href="http://www.sourcetreeapp.com/" rel="noreferrer">SourceTree</a> alongside <a href="https://msysgit.github.io/" rel="noreferrer">Git Bash</a> as git clients.</p>
  
  <p>An examination of the changes in these files shows that nothing has changed in them, except, maybe, the line endings. I don't know how to view the line endings when diffing so can't be sure.</p>
  
  <p>When I try to "discard" these changes, it simply doesn't work. <code>git reset --hard</code> simply has no effect and the changes remain in place.</p>
  
  <p>Why is this happening? How can I make it go away? :)</p>
  
  <p>PS - When I run <code>git config -l</code> I see <code>core.autocrlf=true</code> appear 3 times in the list.</p>
  
  <p>PPS - I have a <code>.gitattributes</code> file in the root of the repository. Deleting it does not have any effect on the above symptoms. It was first added a few days ago. It's all commented out except for <code>* text=auto</code> in the beginning of the file.</p>
  
  <p><strong>UPDATE</strong>: </p>
  
  <p>I've found the minimum steps to reproduce my issue:</p>
  
  <ol>
  <li>I open a file in a text-editor, add a single space somewhere and save it.</li>
  <li>The file appears under "Changes not staged for commit" (obviously).</li>
  <li>I remove the single space from the file and save it.</li>
  <li>The file remains under "Changes not staged for commit" even though both SourceTree's diff and Kdiff3 show that the file is binary equal to its previous version.</li>
  </ol>
  
  <p>Please note that the file in this example had CRLF line endings before I edited it and after I edited it - I don't understand why git insists on marking the file as changed.</p>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>Running <code>git diff --raw MyProject/app.config</code> where MyProject.app/config is one of the files marked as changed gives:</p>
  
  <p><code>:100644 100644 b960510... 0000000... M  MyProject/app.config</code></p>
  
  <p>The fact that the second SHA1 is all zeroes looks like a clue to me - but I don't know what it means.</p>