eclipse:“重新索引存储库工作区”或“计算存储库工作区的 Git 状态”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22397074/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:50:49  来源:igfitidea点击:

eclipse: "re-indexing repository workspace" or "Computing Git status for repository workspace"

eclipsegitcpu-usageegitjgit

提问by mdarwin

I am using eclipse Juno, and yesterday I noticed my computer was getting very hot. I checked the CPU usage to see it was at 100%. Eclipse was the culprit, busy "re-indexing repository workspace". When after half an hour it hadn't finished and my machine was nearly melting, I searched and found these similar problems:

我正在使用 eclipse Juno,昨天我注意到我的电脑变得很热。我检查了 CPU 使用率,发现它是 100%。Eclipse 是罪魁祸首,忙于“重新索引存储库工作区”。半小时后还没完成,我的机器几乎要融化了,我搜索并发现了这些类似的问题:

Re-indexing repository loop - not Maven

重新索引存储库循环 - 不是 Maven

Eclipse hangs on "Re-indexing (fully) repository {username}"

Eclipse 挂起“重新索引(完全)存储库 {username}”

Thing is I'm not using git. And by the sounds of things I don't want to since it's going to eat all my CPU. I removed ~/git, deleted a project I have which uses git, checked for any files under ~/.git, removed egit and jgit from eclipse plugins, and it's still happening.

问题是我没有使用 git。并且通过我不想做的事情的声音,因为它会吃掉我所有的 CPU。我删除了 ~/git,删除了一个使用 git 的项目,检查了 ~/.git 下的所有文件,从 eclipse 插件中删除了 egit 和 jgit,但它仍在发生。

I can stop the process each time, but now it seems unable to build the workspace.

我每次都可以停止该过程,但现在似乎无法构建工作区。

So I decided to upgrade to Kepler, and now I have a similar problem with a different message:

所以我决定升级到 Kepler,现在我遇到了类似的问题,并显示了不同的消息:

"Computing Git status for repository workspace"

“计算存储库工作区的 Git 状态”

Again it's eating 100% of my CPU and threatening to set fire to my desk.

它再次占用了我 100% 的 CPU,并威胁要放火烧我的桌子。

And I don't even have any open git projects.

我什至没有任何开放的 git 项目。

How do I stop this stupid thing? Every time I stop the process, but if I then try to clean rebuild or open a project, it starts up again.

我如何阻止这种愚蠢的事情?每次我停止该过程时,但如果我尝试清理重建或打开一个项目,它会再次启动。

回答by robinst

This was an old bug in EGit where it automatically found the .gitin your home directory and then scanned all the files in the home directory. It has been fixed in newer versions of EGit.

这是 EGit 中的一个旧错误,它会自动.git在您的主目录中找到 ,然后扫描主目录中的所有文件。它已在较新版本的 EGit 中得到修复。

But you may still have the repository configured, even after you upgraded. Do the following:

但是您可能仍然配置了存储库,即使在升级之后也是如此。请执行下列操作:

  1. Open the Git Repositoriesview
  2. Find the repository that causes the problem
  3. In the context menu, select Remove Repository from View
  1. 打开Git 存储库视图
  2. 找到导致问题的存储库
  3. 在上下文菜单中,选择从视图中删除存储库

Then restart Eclipse.

然后重新启动 Eclipse。

回答by David Hackro

In my case, this is my solution

就我而言,这是我的解决方案

Ubuntu 16.04

Ubuntu 16.04

rm -r workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/*/org.eclipse.egit.core
rm -r workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/*/.indexes/properties.index