Rene Terstegen
Rene Terstegen

Reputation: 8046

Can't add files to my repository with Eclipse EGit

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.

Upvotes: 8

Views: 11815

Answers (5)

Ashish gupta
Ashish gupta

Reputation: 31

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

Upvotes: 0

sunyata
sunyata

Reputation: 2221

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

Upvotes: 0

chacac
chacac

Reputation: 71

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.

Upvotes: 7

zaza
zaza

Reputation: 1419

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.

Upvotes: 1

VonC
VonC

Reputation: 1323293

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?

Upvotes: 1

Related Questions