git add .时提示错误,无法添加。报错如下

$ git add .
warning: LF will be replaced by CRLF in uniapp-sdk/components/gprint/encoding-indexes.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in uniapp-sdk/components/gprint/encoding.js.
The file will have its original line endings in your working directory

解决方法

方法1:删除缓存

git rm -r -f --cached .

方法2:设置禁用换行

git config --global core.autocrlf false