Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changes view in IntelliJ continues to list files where the only difference are LF vs CRLF

I have 2 files that won't go away in the Changes view. If I look at the diff, it just tells me the committed version has LF line endings and the local version has CRLF line endings. I'm working on a Mac and I understand linux based systems use LF line endings and Windows use CRLF. Is there someway I can just convert these 2 files so all the line endings are LF?

Thanks.

like image 484
Patrick Grimard Avatar asked Mar 27 '14 00:03

Patrick Grimard


People also ask

How do I show Diff in IntelliJ?

To open the Diff & Merge page, open settings by pressing Ctrl+Alt+S and navigate to Tools | Diff & Merge. Click this button to scroll both differences panes simultaneously. If this button is released, each of the panes can be scrolled independently.

How do I change from CRLF to LF in Git?

text eol=crlf Git will always convert line endings to CRLF on checkout. You should use this for files that must keep CRLF endings, even on OSX or Linux. text eol=lf Git will always convert line endings to LF on checkout. You should use this for files that must keep LF endings, even on Windows.


2 Answers

I had the issue on Windows because I checked out the project using a Cygwin git.exe and IntelliJ used a git.exe from msysGit. Changing the git.exe under Settings -> Version Control -> Git -> Path to Git executable fixed the problem.

like image 157
Sonata Avatar answered Sep 20 '22 10:09

Sonata


In your case, you could:

  • convert those files

  • set core.autocrlf to input:

    git config core.autocrlf input
    
  • reset it (make sure you don't have any work in progress)

    git rm --cached -r .
    git reset --hard
    

See more at "git replacing LF with CRLF".

like image 28
VonC Avatar answered Sep 23 '22 10:09

VonC