Development Tools Introduction to Git First Commits Staging Changed Files

Git Bash for Win warning I am getting on git add.

warning: LF will be replaced by CRLF in medals.html. The file will have its original line endings in your working directory

1 Answer

Rune Andreas Nielsen
Rune Andreas Nielsen
5,342 Points

Hi Christopher,

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). So git is warning you because it will replace the LF with CRLF because you're working on a windows machine.

It should not matter much to you if you're working alone and you're just learning.

If you don't want to deal with the warning all the time you can read the documentation about formatting and whitespace https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#Formatting-and-Whitespace

  • Rune

Rune,

Thank you! That explains it for me. I did figure out how to turn the warning off.