git报错:The file will have its original line endings in your working directory
(该文件将在您的工作目录中有其原始的行尾)
git add . 是表示把当前目录下的所有更新添加至暂存区。有时在终端操作这个会提示:
warning: LF will be replaced by CRLF in ball_pool/assets/Main.js.
The file will have its original line endings in your working directory
解决方法:
git rm -r --cached .
git config core.autocrlf false
git add .
git commit -m '做的一些修改'
在使用git添加文件时,遇到警告提示‘LF will be replaced by CRLF in ball_pool/assets/Main.js. The file will have its original line endings in your working directory’。这个问题涉及到行尾字符的不同格式。解决方案包括:使用`git rm --cached .`移除暂存区的文件,然后通过`git config core.autocrlf false`禁用自动转换,接着再次`git add.`将更改添加到暂存区,并用`git commit -m'做的一些修改'`提交。这样做可以避免Git在不同操作系统间因行尾字符差异引发的问题。
1578

被折叠的 条评论
为什么被折叠?



