4

Our team has people working on macs and windows. So far we had our git automatic line ending set to true (on OSX) and input (on Windows). It works nice, unless there is a merge conflict. In this case both SourceTree and GitKraken mess up the merge on Windows since they see all the lines ending with LF as one line.

Should all of us use the same value of core.autocrlf (in that case which one?) or are there some fixes for specific applications?

Note: Currently we do manual merging when line endings get messed up, but this is painful. Also setting core.autocrlf to false is not an option as wrong line endings on config files crash build on linux.

Miroslav Jonas
  • 5,407
  • 1
  • 27
  • 41
  • 1
    Possible duplicate of [Why should I use core.autocrlf=true in Git?](https://stackoverflow.com/questions/2825428/why-should-i-use-core-autocrlf-true-in-git) – hjpotter92 Jun 23 '17 at 13:22
  • and also https://stackoverflow.com/q/170961 – hjpotter92 Jun 23 '17 at 13:23
  • Does this answer your question? [What's the strategy for handling CRLF (carriage return, line feed) with Git?](https://stackoverflow.com/questions/170961/whats-the-strategy-for-handling-crlf-carriage-return-line-feed-with-git) – Gino Mempin Nov 28 '21 at 08:16

1 Answers1

4

"autocrlf" should be "input" on Unix (Mac/Linux) while "true" on Windows. This is very well-explained on Git's official document under the "Formatting and Whitespacing" section in:

https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration

Pankaj
  • 61
  • 4