一、LF will be replaced by CRLF
1.发现问题
$ git add welcome.txt
warning: LF will be replaced by CRLF in welcome.txt.
The file will have its original line endings in your working directory.
2.分析问题
CRLF:Carriage-Return Line-Feed回车换行
回车:CR,ASCII=13,\r
换行:LF,ASCII=10,\n
者两个ASCII字符不会在屏幕有任何输出,但Windows中广泛来标识一行的结束,而Linux中只有换行符
3.解决问题
删除刚刚生成的.git文件
$ rm -rf .git
$ git config --global core.autocrlf false
然后重新初始化并提交
$ git init
$ git add welcome.txt
时间: 2024-10-15 21:04:36