ERROR:

改了sh文件换行符从Windows提交到Git时报了这个错:

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

warning: LF will be replaced by CRLF in tests/integration-tests/src/main/resources/hp4m-unified-installer-integration-tests.sh. The file will have its original line endings in your working directory.

SOLUTION: 

run: git config --global core.autocrlf false

DESC:

In Unix systems the end of a line is represented with a line feed (LF). In windows a line is represented with a carriage return (CR) and a line feed (LF) thus (CRLF). when you get code from git that was uploaded from a unix system they will only have an LF.

git 会自动根据提交OS系统决定换行符类型(LF/CR),所以提交代码时如果不与当前系统一致会导致上面的错误。

REFERENCE:

关于git如何处理这个

 Git 笔记 随笔

 

 

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄