不同操作系统结束符CRLF转LF
1.下载dos2unix
https://waterlan.home.xs4all.nl/dos2unix/dos2unix-7.4.1-win64.zip
https://waterlan.home.xs4all.nl/dos2unix.html#UNIX2DOS
2.windows批量转换
for /R %G in (*.sh) do dos2unix "%G"
3.linux批量转换
find . -name '*.sh' -exec dos2unix {} \;
4.关闭git自动转换
git config --global core.autocrlf false
5.全部转换完成后,git开启自动转换为LF
git config --global core.autocrlf input
参考链接
http://genge.cc/2020/02/12/批量换行符转换CRLF到LF/
https://rizon.top/tech/转换crlf到lf/
https://jiayaoo3o.github.io/2019/06/26/git项目换行符LF与CRLF导致的大量更改解决办法/