Git错误fatal: CRLF would be replaced by LF in xxx

windowslinux/macos 对换行的使用不同造成
修改相关的 git 配置

git config --global core.autocrlf input
git config --global core.safecrlf warn

配置说明

git config --global core.autocrlf true # add 时去掉CRLF, checkout 时加回CRLF (应该只在win下配置)
git config --global core.autocrlf input # commit 时去掉CRLF, checkout 时什么都不做 (我的选择)
git config --global core.autocrlf false # 什么都不做 (所有开发人员都在相同平台下)
git config --global core.safecrlf warn # 发现CRLF是警告并继续
posted @ 2021-09-18 17:30  Hlooc  阅读(374)  评论(0编辑  收藏  举报