Git 笔记

ERROR:

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

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 笔记_第1张图片

 

 

 

你可能感兴趣的:(Git 笔记)