我正在使用 git-gui 进行版本控制并将它们推送到远程位置。当我尝试重新扫描文件以进行更改时,我收到了这条消息,但我不确定那是什么意思。请帮帮我。
Updating the Git index failed. A rescan will be automatically started to resynchronize git-gui.
warning: LF will be replaced by CRLF in bin/jarlist.cache.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in gen/com/click4tab/pustakalpha/BuildConfig.java.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in proguard-project.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in project.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/layout/start_test.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/menu/start_test.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/com/click4tab/pustakalpha/StartTestActivity.java.
The file will have its original line endings in your working directory.
最佳答案
解决方案是接受这种行为。您使用的是 Windows,因此您应该将 autocrlf
设置为 true
。它就在那里,因此 Git 内部记录中的行尾是一致的。那里有警告,因此您可以查看是否要在提交期间意外损坏二进制文件。
点击继续。如果你想防止它再次发生在这些文件上,你需要取消暂存这些文件,然后更正行尾并再次暂存它们。为此,请在编辑器中将文件的行尾更改为 CRLF/Windows,或删除 these command line tools进入您的 system32
目录,这样您就可以在任何命令提示符下对此类文件执行 unix2dos some_file.java
。
关于git - 更新Git索引失败,LF会被CRLF代替吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12510238/