LF would be replaced

James Brown July 18, 2013

My first attempt at Push I get "LF would be replaced by CRLF in PixelEtherMega.ino" . An INO file is source code for the Arduino.

What do I do with it???

4 answers

0 votes
James Brown July 25, 2013

Confusing things these LFs

0 votes
James Brown July 18, 2013

I re-installed SourceTree but this time I unchecked the box that said "use default line endings".

This time it worked.

MarkJeronimus
Contributor
February 25, 2018

Never saw an option like that during installation of 2.4.8.0, otherwise it would have triggered me immediately.

0 votes
James Brown July 18, 2013

OK - I found my way into MINGW32 via your Terminal icon (I didn't know it had been installed) but it does not have a 'config' option in it.

James Brown July 18, 2013

Now I found my way to git config but when I enter:

git config core.autocrlf false

I get back:

"Error encountered dialog" with the message 'Summary' failed with code 128: fatal:bad config value for 'core.autocrlf' in .git/config

0 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2013

Hi James,

In Windows a line ending is represented by CRLF, and in Unix systems it's represented by LF. The push is just warning you that your line endings are going to be replaced for that file. It sounds like you're working between both Windows and Linux/Mac on your repository.

This can be disabled if you want by setting autocrlf to false so it doesn't convert the line endings on push. This can be done at the command line / terminal when browsed to your repository location by calling the following:

git config core.autocrlf false

Hope that helps

James Brown July 18, 2013

Kieran - Still a problem.


To be sure I uninstalled GIT completly and reinstalled SourceTree. I still get the same error message. BTW its not a warning its game over error.


I had installed SourceTree with GIT internal this time. So now there is no way to run git config core.autodrlf false its not on my computer anymore. Any other ideas?

It sounds like this should be a configuration option in SourceTree don't you think?

MarkJeronimus
Contributor
February 25, 2018

THIS IS VERY DANGEROUS

This answer didn't work for me. The warning was gone but the line endings were still changed SILENTLY. After pushing, I could only delete the remote repository and start over.

I could maybe have prevented this if I had double-checked with

`git config --edit`

But I  didn't know about then, and I can't do it now since I found a way to configure it globally, and this DOES work for me:

`git config --global core.autocrlf true`

Verify:

`git config --global --edit`

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events