Jonathan Mullan
Jonathan Mullan

Reputation: 81

Intellij with git - Contents have differences only in line separators

I've just installed IntelliJ IDEA with git and pulled down code from the framework. Immediately after doing this, I get hundreds (out of thousands) of files saying that 'contents have differences only in line separators'. If I change these from CRLF to LF it makes no difference. Any idea how to fix this?

Upvotes: 8

Views: 11231

Answers (1)

Kartal Tabak
Kartal Tabak

Reputation: 894

One possible reason may be change of line separator style after your checkout, and a missed git reset after that. For example, if you change global config "core.autocrlf" or ".gitattributes" file, you may need to reset git index.

Backup your changes and execute those commands at the root of git repository to reset git index:

rm .git/index
git reset

Upvotes: 5

Related Questions