Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused by GIT error message during commit

Tags:

git

I am new to git and I am confused by this error message that keeps popping up when I commit:
"warning: LF will be replaced by CRLF in New Full Car.mdl. The file will have its original line endings in your working directory."

What does this mean? How can I prevent it from showing me the error on a regular basis?

like image 367
PlTaylor Avatar asked Jan 19 '23 11:01

PlTaylor


2 Answers

This has to do with the core.autocrlf global config option. See this page on github and check out these stackoverflow answers, and more.

like image 117
Nate Avatar answered Jan 27 '23 07:01

Nate


It sounds like git is replacing your linefeeds (LF) with carriage-return line feeds (CRLF), so it's swapping the end line characters on the repository side while leaving them alone in your current working directory. See this link for a description of newline characters.

If you want to avoid seeing that you could just change the newline characters in the New Full Car.mdl - it might do this when you pull from the repository, though if you've already pulled before it looks like it hasn't.

like image 32
thegrinner Avatar answered Jan 27 '23 06:01

thegrinner