The core.autocrlf setting of git controls if line endings are changed when you 1) checkout and/or 2) commit.

It can have the following options:

  • true
  • input
  • false

true means:

  • when you perform a checkout, ensure line endings in the working directory are windows style (\r\n). Any line endings that are not, will be converted.
  • when you perform a commit, convert line endings in the repository to unix style (\n).

input means:

  • when you perform a checkout, don’t mess with line endings, take them the way they were in the repository (i.e. working dir line endings mirror w.e. was in the repo)
  • when you perform a commit, ensure line endings in the repository are unix style

false means:

  • treat line endings just like any other character (i.e. they are a change)
  • in other words:
    • when you checkout, line endings in working dir will be w.e. they were in the repo
    • when you commit, line endings in the repo will be w.e. they were in your working dir
  • core.autocrlf true
    • checkout windows style
    • commit unix style
  • core.autocrlf input
    • checkout w.e. is in repo
    • commit unix style
  • core.autocrlf false
    • treat line endings like any other character