About line endings
Every time you press return on your keyboard you insert an invisible character called a line ending. Different operating systems handle line endings differently.
When you're collaborating on projects with Git and GitHub, Git might produce unexpected results if, for example, you're working on a Windows machine, and your collaborator has made a change in macOS.
You can configure Git to handle line endings automatically so you can collaborate effectively with people who use different operating systems.
Global settings for line endings
The git config core.autocrlf command is used to change how Git handles line endings. It takes a single argument.
On macOS, you simply pass input to the configuration. For example:
$ git config --global core.autocrlf input
# Configure Git to ensure line endings in files you checkout are correct for macOS
On Windows, you simply pass true to the configuration. For example:
$ git config --global core.autocrlf true
# Configure Git to ensure line endings in files you checkout are correct for Windows.
# For compatibility, line endings are converted to Unix style when you commit files.
On Linux, you simply pass input to the configuration. For example:
$