Can't add files to my repository with Eclipse EGit

不羁的心 提交于 2019-12-05 23:27:39

问题


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.


回答1:


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.




回答2:


It could be similar to this thread:

Figured out the problem -- it was to do with Egit, not texlipse.
Turned out that there are issues with multiple projects in a work place, and I had some dead ones I'd removed from the workspace view but whose directories were still there.
Moving these folders out of the workspace seems to have fixed the issue.

Did you try with a workspace with only one project?




回答3:


Is there an exception in the Error Log view? What version of EGit are you on? I know it's not something to be recommended but I'm living on the bleeding edge and use n-builds. They are quite stable and give far more options than the latest stable build.




回答4:


Maybe this has something to do with permissions for other files/directories than .git, i had the same problem after setting up a git project from a root command line in debian, but after redoing the whole thing with from a user account command line there was no problem in eclipse anymore

Kind Regards, Tord




回答5:


its a problem with your folder permission please give the write permission then try . i have a same problem but now resolved.



来源:https://stackoverflow.com/questions/4451773/cant-add-files-to-my-repository-with-eclipse-egit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!