签入签出时对换行符的操作:

#签出时将LF转换为CRLF,签入时将CRLF转换为LF
git config --global core.autocrlf true

#签出时不转换,签入时转换为LF
git config --global core.autocrlf input

#签入签出均不转换(推荐这种,还原事实,保留真相)
git config --global core.autocrlf false

 

包含混合换行符时的操作:

#包含混合换行符时拒绝提交(推荐这种,乱乱的换行符坑队友啊)
git config --global core.safecrlf true

#包含混合换行符时允许提交
git config --global core.safecrlf false

#包含混合换行符时给出警告
git config --global core.safecrlf warn

 

相关文章:

  • 2022-01-12
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-06-25
  • 2021-08-10
  • 2021-08-26
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
相关资源
相似解决方案