背景
mac电脑开发, windows提供服务
问题
windows拉取代码总是提示有文件不同, 与历史提交版本对比并无内容不同, 实际为换行符不同.
mac换行符同linux为LF, windows的为CRLF.
解决方案
在windows执行以下命令:
git config --global core.autocrlf false
拓展
git config --global core.autocrlf input
core.autocrlf设置为input,意思就是检出代码的时候不用转换,提交的时候转换为LF.
git config --global core.autocrlf true
core.autocrlf设置为true,就可以在检出代码的时候将LF结尾转换为CRLF,提交的时候转为LF.
git config --global core.autocrlf false
core.autocrlf设置为false,就会在windows签出中留下CRLF结尾,但在mac和linux系统以及存储库中会留下LF结尾.










