Reputation: 38390
I'm using IntelliJ 11.0 and I'm having a problem with my Git commits. I'm pushing my commits to Github, but when I check Github's commit logs, it shows that I'm removing everything from a file, and then re-adding every single line. Naturally, this makes it very hard to look at the diffs. Is there a way for me to configure IntelliJ or Git so that it doesn't do this, and shows me the proper diffs?
Upvotes: 2
Views: 2334
Reputation: 21485
The usual recommendation is to set core.autocrlf to true in your global .gitconfig on Windows. This will give you CRLF line endings in your working directory and LF line endings in the repository. The conversion happens when files are checkout out into the working directory and when they are committed back into the repository.
The one thing I do not know is whether IntelliJ actually honors that setting, but I'd be very, very surprised if it did not. (Of course, as I understand it, Eclipse has some trouble with it, so maybe I shouldn't be surprised...)
Upvotes: 1
Reputation: 22031
If it's really the problem with line endings - you can change IntelliJ behavior in Settings -> Version Control -> Git
. If you set the setting on Do not convert
IntelliJ doesn't mess with it.
Upvotes: 4