诚实的小猴子

Git中的AutoCRLF与SafeCRLF

一、AutoCRLF

提交时转换为LF,检出时转换为CRLF

1
git config --global core.autocrlf true

提交时转换为LF,检出时不转换

1
git config --global core.autocrlf input

提交检出均不转换

1
git config --global core.autocrlf false

二、SafeCRLF

拒绝提交包含混合换行符的文件

1
2
3
4
5
6
git config --global core.safecrlf true   
```

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

提交包含混合换行符的文件时给出警告

1
git config --global core.safecrlf warn