linux & mac 换行符为/n LF
windows换行符为/r/n CRLF
Windows 下 git默认值可以查看:
git config --global core.autocrlf
若要让程序在两种系统都运行 ;git会在提交时改成LF, checkout时根据系统改回LF or CRLF
git config --global core.autocrlf true
如果只在linux &mac 上运行 ; git会在提交的试试改成LF, checkout不变
git config --global core.autocrlf input
若只在windows上运行 ;
git config --global core.autocrlf false
简单来说,只要开启aotocrlf就好了
git config --global core.autocrlf true