Configuring line endings
suggest changeDescription
When working with a team who uses different operating systems (OS) across the project, sometimes you may run into trouble when dealing with line endings.
Microsoft Windows
When working on Microsoft Windows operating system (OS), the line endings are normally of form - carriage return + line feed (CR+LF). Opening a file which has been edited using Unix machine such as Linux or OSX may cause trouble, making it seem that text has no line endings at all. This is due to the fact that Unix systems apply different line-endings of form line feeds (LF) only.
To fix this, run:
git config --global core.autocrlf true
On checkout, this converts LF to CR+LF. On commit, CR+LF is stored as LF.
Unix Based (Linux/OSX)
Similarly, there might be issues when the user on Unix based OS tries to read files which have been edited on Microsoft Windows OS. In order to prevent any unexpected issues run
git config --global core.autocrlf input
On commit, this converts CR+LF to LF. Checkout leaves line endings unchanged.