Git End-of-Line Normalization by AutoCRLF with Input
Using Vagrant file provision in a Windows host, the line endings are not converted from CRLF to LF (Linux systems). So, code cannot be executed properly in the guest Linux system. And also this is a frequently occurred message for working with Windows:
|
|
One solution is to use UNIX line ending (LF) even in Windows, hence no conversion is needed. This is done by setting:
|
|
Which means when committing the code to a remote repository, the line ending will be convert from CRLF to LF if any, but when checking out from the remote directory, no conversion from LF to CRLF is performed.
Also, use .gitattributes
file per repository to ensure consistent behavior for all users.
|
|
This ensures that all text files will have line endings set to LF in the repository and your working directory.
See man gitattributes
, and git help config
, and Deal with line endings.