无法使用Eclipse EGit将文件添加到我的存储库 [英] Can't add files to my repository with Eclipse EGit
问题描述
我将Eclipse(Helios)与PDT和EGit一起使用。我有一个没有版本控制的项目,因此我为此创建了一个git存储库:
Team->共享项目
当我尝试将项目文件添加到存储库中时:
团队->添加
我遇到一个例外:
无法将资源添加到索引
$时捕获到异常p $ p>
未能将资源添加到索引
执行添加命令
当我在命令行上手动添加文件时,一切正常。
有什么想法吗?
编辑:
eclipse给出的错误是:
原因:org.eclipse.jgit.errors.ObjectWritingException:无法创建新对象:Z:\age_layout\.git\objects\60\f30dd232bd6ddaeb198fb11400c2613a072189
at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insert(ObjectDirectoryInserter.java:100) org.eclipse.jgit.api.AddCommand.call(AddCommand.java:177)
我的代码正在运行的设备位于在CentO上运行的虚拟机上。我正在Windows机器上工作,并使用samba共享来访问虚拟机上的代码。我已将.git目录中的文件系统权限设置为777,但仍然无法正常工作。
解决方案类似的问题,例如egit未能添加某些文件,但未添加其他文件。经过数小时的浪费,我终于找到了解决我问题的方法。添加core.autocrlf = false解决了该问题。
I use Eclipse (Helios) with PDT and EGit. I have a project without versioning, so I created a git repository for it by doing:
Team -> Share Project
When I try to add the files of my project to the repository:
Team -> Add
I get an exception:
Failed to add resource to index Failed to add resource to index Exception caught during execution of add command
When I add the files manually on the command line, everything is working fine.
Any ideas?
EDIT:
The error eclipse gives is:
Caused by: org.eclipse.jgit.errors.ObjectWritingException: Unable to create new object: Z:\eage_layout\.git\objects\60\f30dd232bd6ddaeb198fb11400c2613a072189 at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insert(ObjectDirectoryInserter.java:100) at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:177)
The code I'm running is located on a virtual machine running on CentOs. I'm working on a windows machine and using a samba share to get access to the code on the virtual machine. I've put the filesystem permissions on my .git directory to 777, but still it does not work.
解决方案I had a similar problem, where egit was failing on adding some files but not others. After many wasted hours I finally found the solution to my issue. Adding core.autocrlf=false solved the problem.
这篇关于无法使用Eclipse EGit将文件添加到我的存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!