eclipse中git插件提交报错:org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during executi

前言:

上午项目提交还是可以的,下午不知道怎么回事提交不了,报错信息如下;郁闷,于是百度一下终于解决了。
在这里这里记录一下。

报错信息:

org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution 

of add command
    at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:208)
    at org.eclipse.jgit.api.CommitCommand.call(CommitCommand.java:168)
    at org.eclipse.egit.core.op.CommitOperation.commitAll

(CommitOperation.java:286)
    at org.eclipse.egit.core.op.CommitOperation.access$1

(CommitOperation.java:279)
    at org.eclipse.egit.core.op.CommitOperation$1.run(CommitOperation.java:186)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2327)
    at org.eclipse.egit.core.op.CommitOperation.execute

(CommitOperation.java:204)
    at org.eclipse.egit.ui.internal.commit.CommitJob.run(CommitJob.java:94)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: org.eclipse.jgit.errors.LockFailedException: Cannot lock C:\Users\xy\git\项目名\.git\index
    at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:224)
    at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:301)
    at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:267)
    at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:1049)
    at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:138)
    ... 9 more

错误截图:
eclipse中git插件提交报错:org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during executi_第1张图片


解决方法:

原因:不能提交的原因是git被锁定了,删除下面文件即可。

删除文件:git视图—你的项目—Working Directory—.git—index.lock

删除文件,即可提交。

eclipse中git插件提交报错:org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during executi_第2张图片

文章参考:
https://stackoverflow.com/questions/14671971/eclipse-egit-failed-to-commit

你可能感兴趣的:(myeclpse问题)