What's the best CRLF (carriage return, line feed) handling strategy with Git?

后端 未结 9 1739
青春惊慌失措
青春惊慌失措 2020-11-22 07:30

I tried committing files with CRLF-ending lines, but it failed.

I spent a whole work day on my Windows computer trying different strategies and was almost drawn to s

9条回答
  •  隐瞒了意图╮
    2020-11-22 08:22

    Using core.autocrlf=false stopped all the files from being marked updated as soon as I checked them out in my Visual Studio 2010 project. The other two members of the development team are also using Windows systems so a mixed environment didn't come into play, yet the default settings that came with the repository always marked all files as updated immediately after cloning.

    I guess the bottom line is to find what CRLF setting works for your environment. Especially since in many other repositories on our Linux boxes setting autocrlf = true produces better results.

    20+ years later and we're still dealing with line ending disparities between OSes... sad.

提交回复
热议问题