title: Why does git think each line of an untouched file has changed
body: <p>I don't think it's a line ending difference issue - p4merge does not think anything has changed in the file, even when set to recognize line ending and white space differences.</p>
  
  <p>My issue is that sometimes the following happens:</p>
  
  <ul>
  <li>At first <code>git status</code> shows no uncommitted changes.</li>
  <li>Then I checkout another branch</li>
  <li>Now <code>git status</code> lists some files as changed.</li>
  <li><code>git diff</code> on any of those "changed files" shows every line of the file as changed. The changed version appears the same as the original version.</li>
  </ul>
  
  <p>Why is this happening? Why does git think the files have changed, when they appear to not have done that? Why does just checking out another branch cause this?</p>
  
  <p>My first thought was line endings, but I don't know why p4merge would not detect those. Second idea was file mode changes. I don't know how to find out if that's the case. <code>git config --list</code> shows core.filemode is set to false. <code>git config --global --list</code> and <code>git config --system --list</code> don't show any setting for core.filemode (I tell this here since I'm not sure how different config levels override each other). core.autocrlf is set to true.</p>
  
  <p>Multiple developers commit to the same repository I'm pulling changes from, all on Windows machines. I'm guessing someone somewhere has some setting in a position that's causing this, but I don't know if it's me locally or someone else, or what setting it could be.</p>
  
  <p>The files listed as changed don't appear to be random - if I delete my local repository, clone it again from the remote (which defaults to master branch being checked out), and checkout that same branch again, <code>git status</code> lists the exact same files as changed, every time. The files are sometimes something recently edited, sometimes files that have not been touched in years. They are also not only binary files (that <code>core.autocrlf=true</code> is known to corrupt at times), but text files as well.</p>
  
  <p>Doing commands <code>git rm --cached -r .</code> followed with <code>git reset --hard</code> gets rid of the changes, but it's occurring so often it's getting bothersome. I'm also curious what could be causing this.</p>
  
  <p>Same repository is also causing line ending problems. I think this is a separate issue, so I'll probably end up making another question for it, but I mention it here briefly in case it's related after all. Checking out another branch or pulling changes from remote repository sometimes causes files appear as changed, and <code>git diff</code> on those files only outputs <code>warning: LF will be replaced by CRLF in [file]. The file will have its original line endings in your working directory.</code></p>
  
  <p>Edit: The .gitattributes file of the repository has only the line <code>* text=auto</code> and nothing else in it.</p>
  
  <p>Output of <code>git config --list</code> (ommitted settings with things like colors, file paths to editor, remote, difftool, user name and email and such):</p>
  
  <pre><code>core.symlinks=false
  core.autocrlf=true3
  pack.packsizelimit=2g
  rebase.autosquash=true
  merge.summary=true
  core.repositoryformatversion=0
  core.filemode=false
  core.bare=false
  core.logallrefupdates=true
  core.symlinks=false (yes this is there twice, just noticed)
  core.ignorecase=true
  core.hidedotfiles=dotgitOnly
  </code></pre>