I changed my line endings settings in Git. I still can't stage files due to line endings in SourceTree

724 Views Asked by At

I used this global setting:

$ git config --global core.autocrlf input

Which should leave line endings in LF on my OSX system. I then try to stage files in sourcetree but receive but receive this fatal error:

fatal: CRLF would be replaced by LF in...

To my understanding, I want to convert CRLF to LF on my OSX system, correct? Is that git cmd above incorrect for that? Why do I receive this fatal error in SourceTree? Also, I hate git.

2

There are 2 best solutions below

1
Benjamin Close On

There's instructions here, that provide you with details about how to fix the problem. You need to reset your index and commit fixed files before continuing now you've made the change.

0
rpeg On

This solved my problem (likely in addition to the post from Benjamin Close). Don't know why.

$ git config --global core.autocrlf false
$ git config --global core.safecrlf false

git commit get fatal error "fatal: CRLF would be replaced by LF in"