title: Git detects changed files that are actually byte-identical
body: <p>I have an issue with git (through tortoise git) that shows some files of my project as modified, but they are actually not modified. I have double-checked that by making a fresh clone of the repository, and, without touching it, I already have git detect "modified" files in the newly created working copy. This is annoying because some operations are blocked (because that would override my "modified" files), but I can't revert them, deleting+revert doesn't work either. Committing the "changes" works but it's not an ideal solution.</p>
  
  <p>I'm on Windows, using TortoiseGit 1.8.16.0 and Git 2.6.4. Using <code>git status</code> directly also shows the same files are "modified".</p>
  
  <p>This seems to happen only in a directory of my project that used to be a submodule, but I'm now using git subtree. So at some time, I removed the submodule completely (or so I think), and created a subtree.</p>
  
  <p>Did anyone have the same issue? How could I fix it once and for all? (even after committing the "changes", some time later, sometimes weeks later, I will have other files, or sometimes the same files, starting to show the same weird issue).</p>
  
  <p>Here is the result of diff on one of those files: <code>git diff app.config</code></p>
  
  <pre><code>diff --git a/Ozytis.Common/Web/app.config b/Ozytis.Common/Web/app.config
  index 3686aab..f559fe7 100644
  --- a/Ozytis.Common/Web/app.config
  +++ b/Ozytis.Common/Web/app.config
  @@ -1,25 +1,25 @@
  -&lt;U+FEFF&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
  -&lt;configuration&gt;
  -  &lt;configSections&gt;
  -    &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
  -    &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=ne
  utral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
  -  &lt;/configSections&gt;
  -  &lt;runtime&gt;
  -    &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
  -      &lt;dependentAssembly&gt;
  -        &lt;assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /&gt;
  -        &lt;bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /&gt;
  -      &lt;/dependentAssembly&gt;
  -    &lt;/assemblyBinding&gt;
  -  &lt;/runtime&gt;
  -  &lt;entityFramework&gt;
  -    &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
  -      &lt;parameters&gt;
  -        &lt;parameter value="v11.0" /&gt;
  -      &lt;/parameters&gt;
  -    &lt;/defaultConnectionFactory&gt;
  -    &lt;providers&gt;
  -      &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
  -    &lt;/providers&gt;
  -  &lt;/entityFramework&gt;
  +&lt;U+FEFF&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
  +&lt;configuration&gt;
  +  &lt;configSections&gt;
  +    &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
  +    &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=ne
  utral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
  +  &lt;/configSections&gt;
  +  &lt;runtime&gt;
  +    &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
  +      &lt;dependentAssembly&gt;
  +        &lt;assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /&gt;
  +        &lt;bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /&gt;
  +      &lt;/dependentAssembly&gt;
  +    &lt;/assemblyBinding&gt;
  +  &lt;/runtime&gt;
  +  &lt;entityFramework&gt;
  +    &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
  +      &lt;parameters&gt;
  +        &lt;parameter value="v11.0" /&gt;
  +      &lt;/parameters&gt;
  +    &lt;/defaultConnectionFactory&gt;
  +    &lt;providers&gt;
  +      &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
  +    &lt;/providers&gt;
  +  &lt;/entityFramework&gt;
   &lt;/configuration&gt;
  \ No newline at end of file
  </code></pre>
  
  <p>For this file, the diff shows all lines are modified. However, I checked with an hexadecimal editor with previous and current version of the file, line feeds are the same, in fact every single byte is the same.</p>
  
  <p>Also, some files show only a few lines are different (but again, they are not). Even though the whole file has consistent line feeds.</p>