更新Git索引失败,LF将被CRLF替换? [英] Updating the Git index failed, LF will be replaced by CRLF?

查看:4046
本文介绍了更新Git索引失败,LF将被CRLF替换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用git-gui进行版本控制,并将它们推送到远程位置。当我尝试重新扫描文件进行更改时,我收到了此消息,但我不确定这意味着什么。请帮我在这里。

I'm using git-gui for version control and pushing them to remote locations. When I tried to Rescan files for changes, I got this message and I'm not sure what that means. Please help me out here.

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内部记录中的行结束是一致的。警告在那里,您可以看到在提交期间是否意外地损坏了二进制文件。

The solution is to accept that behaviour. You're on Windows so you should have autocrlf as true. It's there so line-endings in Git's internal records are consistent. The warnings are there so you can see if you're about to accidentally corrupt binary files during a commit.

点击继续。如果你想防止它再次发生在这些文件上,你需要取消这些文件,然后纠正行结束并再次分阶段。通过在编辑器中将文件的行结束符更改为CRLF / Windows,或者删除这些命令行工具放到你的 system32 目录下,这样你就可以在任何命令提示符下对这些文件执行 unix2dos some_file.java

Click Continue. If you want to prevent it happening on those files again, you need to unstage those files, then correct the line-endings and stage them again. Do so by changing the line-endings of the file to CRLF/Windows in your editor, or drop these command line tools into your system32 directory so you can do unix2dos some_file.java on such files at any command prompt.

这篇关于更新Git索引失败,LF将被CRLF替换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆