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.
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.
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.
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.
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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With