用Mac在IDEA中提交时,遇到问题:
直接点第一个按钮【Commit As Is】,按原样提交,就行。
或了解下第二种解决方案:
在 Windows 下,由回车 CR(0x0D)(\r)和换行 LF(0x0A)( \n))共同标志一行的结束。
而在 Linux和Mac 环境下,每一行的结束仅有一个换行 LF(0x0A)(\n)。
在Git中有一项 core.autocflf 配置项,它可以被配置为 true,false和input,它们分别表示:
// 提交时转换为LF,检出时转换为CRLF
git config --global core.autocrlf true
// 提交时转换为LF,检出时不转换
git config --global core.autocrlf input
// 提交检出均不转换
git config --global core.autocrlf false
使用了此命令:
git config --global core.autocrlf input
再次提交,大功告成!
参考:
https://blog.csdn.net/wdd1324/article/details/84963919
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-config.html
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitattributes.html