Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't add files to my repository with Eclipse EGit

Tags:

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.

like image 923
Rene Terstegen Avatar asked Dec 15 '10 15:12

Rene Terstegen


1 Answers

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.

like image 97
chacac Avatar answered Oct 12 '22 20:10

chacac