lf crlf

Line feed & Carriage return

In Unix systems the end of a line is represented with a line feed LF. In windows a line is represented with a carriage return (CR) and a line feed (LF) thus CRLF. When you get code from git that was uploaded from a unix system they will only have an LF.

I used one of the existing themes for my HUGO website. Looks like it was from a Unix file system. With my current development environment being Windows, I kept getting the following issue:

warning: LF will be replaced by CRLF in til/til-example/index.html. The file will have its original line endings in your working directory.

Although this wasn’t the first time I have seen this, I have chosen to ignore this all while. But it was worth learning. I got rid of the warning with the following git command:

git config core.autocrlf false

More on the above command from git documentation:

Part 1 Part 1


This answer from StackOverflow helped me.

Published by in May, TIL, Technical and 2017 and tagged crlf, file system and lf using 159 words.