Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 789
Jonathan Mullan Avatar asked Feb 22 '17 18:02

Jonathan Mullan


1 Answers

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
like image 54
Kartal Tabak Avatar answered Sep 18 '22 03:09

Kartal Tabak