无法使用 Eclipse EGit 将文件添加到我的存储库

发布于 2024-10-07 22:41:14 字数 928 浏览 3 评论 0原文

我将 Eclipse (Helios) 与 PDT 和 EGit 一起使用。我有一个没有版本控制的项目,所以我通过以下方式为其创建了一个 git 存储库:

Team -> Share Project

当我尝试将项目的文件添加到存储库时:

Team -> Add

我得到一个异常:

Failed to add resource to index
    Failed to add resource to index
    Exception caught during execution of add command

当我在命令行上手动添加文件时,一切都是工作正常。

有什么想法吗?

编辑:

eclipse 给出的错误是:

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)

我正在运行的代码位于 CentOs 上运行的虚拟机上。我正在 Windows 计算机上工作,并使用 samba 共享来访问虚拟机上的代码。我已将 .git 目录的文件系统权限设置为 777,但它仍然不起作用。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

心意如水 2024-10-14 22:41:14

我遇到了类似的问题,egit 无法添加一些文件,但无法添加其他文件。经过许多浪费时间后,我终于找到了解决我的问题的方法。添加 core.autocrlf=false 解决了问题。

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.

无戏配角 2024-10-14 22:41:14

它可能类似于此线程

解决了问题——这与 Egit 有关,而不是 texlipse。
事实证明,工作场所中的多个项目存在问题,并且我从工作区视图中删除了一些死项目,但其目录仍然存在。
将这些文件夹移出工作区似乎已经解决了问题。

您是否尝试过使用只有一个项目的工作区?

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?

清眉祭 2024-10-14 22:41:14

错误日志视图中是否有异常?您使用的是哪个版本的 Egit?我知道这不是值得推荐的东西,但我生活在最前沿并使用 n-builds< /a>.它们非常稳定,并且比最新的稳定版本提供更多的选择。

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.

饮湿 2024-10-14 22:41:14

也许这与 .git 之外的其他文件/目录的权限有关,在 debian 中从根命令行设置 git 项目后,我遇到了同样的问题,但在从用户帐户命令行重做整个事情之后在日食中不再有问题

亲切的问候,托德

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

爱的故事 2024-10-14 22:41:14

您的文件夹权限有问题,请授予写入权限,然后尝试。我有同样的问题,但现在已经解决了。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文