尝试从 Eclipse 中的 eGit 提交到 git 时出现“发生内部错误”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10037305/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"An internal error occurred" when trying to commit to git from eGit in Eclipse
提问by rogueleaderr
[SOLVED] Somehow, I managed to not have "write" permissions to the .git directory. So was trying to write the commit and getting bounced.
[已解决] 不知何故,我设法没有对 .git 目录的“写入”权限。所以试图编写提交并被退回。
I've been using Eclipse for a few months, but had been just running git from the CLI. I decided that was inefficient and that I wanted to use eGit, so I started following this tutorial (http://www.slideshare.net/loianeg/using-the-egit-eclipse-plugin-with-git-hub-2578587?from=embed).
我已经使用 Eclipse 几个月了,但只是从 CLI 运行 git。我认为这是低效的,我想使用 eGit,所以我开始学习本教程 (http://www.slideshare.net/loianeg/using-the-egit-eclipse-plugin-with-git-hub-2578587?来自=嵌入)。
I'm trying to add an existing project, so I did Team-->Share Project-->Git and selected the .git corresponding to my project. Eclipse seems to have picked it up, okay, but when I try to commit, I get a popup saying
我正在尝试添加一个现有项目,所以我做了 Team-->Share Project-->Git 并选择了与我的项目相对应的 .git。Eclipse 似乎已经接受了,好吧,但是当我尝试提交时,我收到一个弹出窗口说
"Committing changes has encountered a problem' -- an internal error occured.
“提交更改遇到问题”——发生内部错误。
When I click details, it say "An internal error occurred Exception caught during execution of commit command"
当我单击详细信息时,它说“在执行提交命令期间发生内部错误发生异常”
...I don't even know where to start on this one. I googled the error and didn't get anything useful.
...我什至不知道从哪里开始这个。我用谷歌搜索了错误并没有得到任何有用的信息。
Anyone know how to fix this, or at least how to start debugging?
任何人都知道如何解决这个问题,或者至少如何开始调试?
回答by Bruno Pinto
I've solved my case removing index.lock file from the git folder of the project.
我已经解决了从项目的 git 文件夹中删除 index.lock 文件的情况。
回答by VonC
- start debugging?
Check the "Errors" Eclipse view for a full Stack Trace associate with that error message
- 开始调试?
检查“错误”Eclipse 视图以获取与该错误消息关联的完整堆栈跟踪
Example of an Error View:
错误视图示例:
- fix it?
If the Exception is a NPE one (NullPointerException), like shown in bug 329611, then you can try a git commit -m "a message" in a shell, in order to get past that initial first commit with a GUI.
- 修理它?
如果异常是 NPE 异常 (NullPointerException),如错误 329611 中所示,那么您可以在 shell 中尝试 git commit -m "a message",以便通过 GUI跳过最初的第一次提交。
As the OP rogueleaderrmentions, the error view and the exact stack trace behind the exception was enough:
正如OP rogueleaderr 所提到的,错误视图和异常背后的确切堆栈跟踪就足够了:
Somehow, I managed to not have "write" permissions to the
.git
directory.
So was trying to write the commit and getting bounced.
不知何故,我设法没有对该
.git
目录的“写入”权限。
所以试图编写提交并被退回。
回答by AnVo
I face this problem too, Error tab doesn't show anything more. So I use GitExtension to commit instead, problem solved.
我也面临这个问题,错误选项卡不再显示任何内容。所以我改用 GitExtension 来提交,问题解决了。
Using parallel eGit and GitExtension to keep tracking a local git repo is a good idea. It's update runtime on both Eclipse and GitExtension when we make change on each.
使用并行 eGit 和 GitExtension 来跟踪本地 git 存储库是一个好主意。当我们对 Eclipse 和 GitExtension 进行更改时,它都会更新运行时。
回答by boobalan
I faced this problem. I delete the .git
folder and .gitignore
file push to upstream it works correctly.
我遇到了这个问题。我删除了.git
文件夹并将.gitignore
文件推送到上游,它可以正常工作。
回答by tricknology
I had this same issue. I resolved it by committing manually from terminal using (in this order):
我有同样的问题。我通过使用(按此顺序)从终端手动提交来解决它:
git add .
then git commit
and lastly, git push
from the local repo directory.
git add .
然后git commit
,最后,git push
从本地 repo 目录。
回答by Sravan Palaki
I faced similar problem, It was resolved after deleting index.lock file in .git\ folder.
我遇到了类似的问题,删除 .git\ 文件夹中的 index.lock 文件后解决了。