Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I want normalized line endings?

I am getting the following message in Visual Studio 2008:

The line endings in the following file are not consistent. Do you want to normalize the line endings?

I don't understand what that means. Should I be clicking yes or no?

enter image description here

like image 751
Urbycoz Avatar asked Apr 14 '11 15:04

Urbycoz


People also ask

Should I use CRLF or LF?

Whereas Windows follows the original convention of a carriage return plus a line feed ( CRLF ) for line endings, operating systems like Linux and Mac use only the line feed ( LF ) character. The history of these two control characters dates back to the era of the typewriter.

How should git treat line endings?

This is a good default option. 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.

What is end of line normalization?

End of Line (EOL) or line ending is some special character that indicates text editors to show a new line for text files. • Most typical EOL: • LF (line feed) – Unix and Unix-like systems (Linux, MacOS…etc.)

How do I know if a file is LF or CRLF?

use a text editor like notepad++ that can help you with understanding the line ends. It will show you the line end formats used as either Unix(LF) or Macintosh(CR) or Windows(CR LF) on the task bar of the tool. you can also go to View->Show Symbol->Show End Of Line to display the line ends as LF/ CR LF/CR.


1 Answers

The correct answer is almost always "Yes" and "Windows (CR LF)". The reason is that line endings in source files should almost always be consistent within the file and source files on Windows should generally have CR LF endings. There are exceptions but if if they applied to you, you would probably know about them. The warning is a good one because it informs you that somehow the file got into this inconsistent state and because it gives you a choice for how to handle the situation.

like image 171
Rick Sladkey Avatar answered Oct 06 '22 21:10

Rick Sladkey