0

I encountered the following message while using Git with react-native: warning: LF will be replaced by CRLF in index.js. The file will have its original line endings in your working directory

What does LF and CRLF mean in this warning, and what does the warning mean?

Lisbeth
  • 129
  • 2
  • 11
Author
  • 425
  • 1
  • 4
  • 16
  • 2
    Possible duplicate of [Difference between CR LF, LF and CR line break types?](https://stackoverflow.com/questions/1552749/difference-between-cr-lf-lf-and-cr-line-break-types) – melpomene Nov 29 '18 at 01:13
  • https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf – melpomene Nov 29 '18 at 01:13

1 Answers1

2

LF is line feed and CRLF is Carriage Return - Line Feed. They both refer to the ASCII code(s) of how the new lines in your files are stored. As a programmer, you might have run into the problem that sometimes you need to do \n (LF) and other times you have to do \r\n (CRLF) to get a new line to output.

Git is telling you that when it commits the file changes, it will store the new lines as the DOS-style (CRLF) instead of the Unix-style (LF).

tazer84
  • 1,743
  • 12
  • 11