git diff is showing full file has changed for a single line change but only for few files in a directory
<p>I have come across a strange problem in <strong>GIT</strong>. Recently our codebase has moved to GIT from SVN. So, when I have cloned the repository on my local and I am doing single line change in a file, git diff is showing full file has changed (first all the content has deleted and then all the content added again). But strange thing is it's not happening for all the files.   </p>

<p>e.g. I have changed (e.g. added a space after a line) my <code>app.js</code>, <code>index.html</code> and <code>gruntfile.js</code> where it's showing correct line diff for <code>app.js</code> and full file change for <code>index.html</code> and <code>gruntfile.js</code></p>

<p>I have referred many stackoverflow articles and set <code>core.autocrlf</code> to <code>true</code> and <code>false</code> both but none of the setting worked.  </p>

<p>Another strange thing is I am unable to reset that file also. Suppose in the above example if I do <code>git reset --hard</code>, it doesn't remove/revert the defected files from my local, here <code>app.js</code> has been reverted but other two did not revert. Finally I had to use <code>git checkout .</code> to revert all the files.  </p>

<p><strong>Update:</strong> This is my .gitattribute file content in the root directory.
<code>* text=auto</code>  </p>

<p>And this is my .editorconfig file in the root directory.</p>

<pre><code>root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
</code></pre>