title: git sees entire file as one line due to mac line endings
body: <p>I am working on Windows platform, with files in Mac ANSI encoding</p>
  
  <p>when I edit a single line of a file, and then do a <code>git diff</code>, this is what I see:</p>
  
  <pre><code>diff --git a/class.php b/class.php
  @@ -1 +1 @@
  -&lt;?php^Mclass Type {^M^M   private $x;// level^M ..etc
  \ No newline at end of file
  +&lt;?php^Mclass Type {^M^M   private $x;// level^M ..etc
  \ No newline at end of file
  </code></pre>
  
  <p>In other words, git sees my file as a single line, due to the mac line endings.  I have looked at various posts on git hub and got tried a few solutions, but neither worked.  I am kind of lost as to what is going on and how to commit my files properly.</p>
  
  <p>Links I have tried:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/1889559/git-diff-to-ignore-m">git-diff to ignore ^M</a></li>
  <li><a href="https://help.github.com/articles/dealing-with-line-endings#platform-windows" rel="nofollow noreferrer">https://help.github.com/articles/dealing-with-line-endings#platform-windows</a></li>
  <li><a href="http://lostechies.com/keithdahlby/2011/04/06/windows-git-tip-hide-carriage-return-in-diff/" rel="nofollow noreferrer">http://lostechies.com/keithdahlby/2011/04/06/windows-git-tip-hide-carriage-return-in-diff/</a></li>
  </ul>
  
  <p>Still same ^M in lines.  git does not seem to handle \r on Windows quite well.  Must I convert entire repo line endings to say \r\n?  Is there not a solution to leave mac encoding as is?</p>
  
  <p><strong>More info:</strong> </p>
  
  <p>My .gitattributes file:</p>
  
  <pre><code># Set default behaviour, in case users don't have core.autocrlf set.
  * text=auto
  
  # Explicitly declare text files we want to always be normalized and converted
  # to native line endings on checkout.
  *.php text
  *.inc text
  *.js text
  *.txt text
  
  # Declare files that will always have CRLF line endings on checkout.
  *.sln text eol=crlf
  
  # Denote all files that are truly binary and should not be modified.
  *.png binary
  *.jpg binary
  *.gif binary
  </code></pre>
  
  <p>I ran this command:  <code>git config --global core.autocrlf true</code></p>