window git crlf lf 换行符问题

一、Git 换行符配置

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

二、autocrlf saftcrlf

1)autocrlf参数说明

// 提交时转换为LF,检出时转换为CRLF
git config --global core.autocrlf true   

// 提交时转换为LF,检出时不转换
git config --global core.autocrlf input   

// 提交检出均不转换
git config --global core.autocrlf false

2)saftcrlf参数说明

// 拒绝提交包含混合换行符的文件
git config --global core.safecrlf true   

// 允许提交包含混合换行符的文件
git config --global core.safecrlf false   

// 提交包含混合换行符的文件时给出警告
git config --global core.safecrlf warn

 

参考:gitattributes

posted @ 2020-07-22 11:15  dearyang  阅读(6)  评论(0)    收藏  举报