Eclipse Git Synchronize 不显示更改

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

Eclipse Git Synchronize does not display changes

eclipsegitegitsynchronize

提问by vRallev

No matter what I do, Eclipse (EGit) doesn't display the changes. I've searched a lot for this issue, but cannot solve it. A friend of mine has the same issue. In the past everything worked fine, but from one day to the other the issue occured.

无论我做什么,Eclipse (EGit) 都不会显示更改。我已经搜索了很多关于这个问题,但无法解决它。我的一个朋友也有同样的问题。过去一切正常,但从一天到一天,问题发生了。

When I hit Team > Synchronize Workspace, only the dialog "Synchronizing Git: No changes found." appears. When I choose Team > Advanced > Synchronize, the same happens.

当我点击Team > Synchronize Workspace 时,只出现对话框“同步 Git:未找到更改。”。当我选择Team > Advanced > Synchronize 时,也会发生同样的情况。

I also installed a new Eclipse (with a fresh Windows) and issue was still there. With my Ubuntu notebook everything is fine.

我还安装了一个新的 Eclipse(带有新的 Windows),但问题仍然存在。使用我的 Ubuntu 笔记本一切正常。

Does anybody have the same issue? Is there a solution? I also tried to install the plugins mentioned in this answer, but it didn't work for me.

有人有同样的问题吗?有解决办法吗?我还尝试安装此答案中提到的插件,但它对我不起作用。

UpdateEclipse also displays incoming changes (after fetching from upstream) and the changed files (with an arrow), but the synchronize view still doesn't show the changes.

更新Eclipse 还显示传入的更改(从上游获取后)和更改的文件(带有箭头),但同步视图仍然不显示更改。

Update 2I've tested a project from Github and there everything works as apected. What could be the difference between these two projects? I've checked the repository settings and they are equal. Could the authentication cause the issues? Like I've said, the project works fine on my Ubuntu machine.

更新 2我已经测试了 Github 的一个项目,并且一切正常。这两个项目之间可能有什么区别?我检查了存储库设置,它们是相同的。身份验证会导致问题吗?就像我说的,该项目在我的 Ubuntu 机器上运行良好。

采纳答案by DanN

I used to have the same problem but upgrading to EGit 2.2 seems to have taken care of it. Things are now consistent between "git status" at command line and "Team / Synchronize Workspace" in Eclipse.

我曾经遇到过同样的问题,但升级到 EGit 2.2 似乎已经解决了它。现在,命令行中的“git status”和 Eclipse 中的“Team / Synchronize Workspace”之间保持一致。

You can get EGit from hereor you can add the update site http://download.eclipse.org/egit/updates-2.2to Eclipse.

您可以从这里获取 EGit,也可以将更新站点http://download.eclipse.org/egit/updates-2.2添加到 Eclipse。

Latest Egit Update Site:http://download.eclipse.org/egit/updates

最新的 Egit 更新站点:http : //download.eclipse.org/egit/updates

回答by Dejan Milosevic

I've tried the new EGit, re-cloning the project and nothing worked except this:

我已经尝试了新的 EGit,重新克隆了该项目,但除此之外没有任何效果:

  1. In the Synchronize view, click on the dropdown arrow next to Synchronize button, then select "Synchronize...".
  2. In the dialog that appears choose Git, press Next.
  3. Then the crucial part - select destination to be HEAD for your repository and check "Include local uncommitted changes in comparison".
  4. Click Finish.
  1. 在“同步”视图中,单击“同步”按钮旁边的下拉箭头,然后选择“同步...”。
  2. 在出现的对话框中选择 Git,然后按下一步。
  3. 然后是关键部分 - 为您的存储库选择目标作为 HEAD 并选中“在比较中包含本地未提交的更改”。
  4. 单击完成。

回答by Stefan Ferstl

Before you can synchronize your workspace, you need to do a "fetch" from the remote repository (Team -> Fetch from Upstream) to get all the incoming changes into your local repository. Afterwards you can synchronize them.

在您可以同步您的工作区之前,您需要从远程存储库 ( Team -> Fetch from Upstream)执行“提取”操作,以将所有传入的更改放入您的本地存储库中。之后,您可以同步它们。

If you don't want to make two clicks for synchronizing, you can enable "Always launch fetch before synchronisation" in Preferences -> Team -> Git -> Synchronize.

如果您不想点击两次进行同步,您可以在Preferences -> Team -> Git -> Synchronize.

enter image description here

在此处输入图片说明

回答by Mohit Baluja

Staged ChangesThis has worked for me :

分阶段更改这对我有用

Whenever you made any changes. Right click on your Project name then Go to Team and click on "Add to Index". Now again Right click on your Project Name then Go to Team and click on "Commit". Now You will see that Git Staging console has been opened and the changes you have made are started displaying in Staged Changes box.

每当您进行任何更改时。右键单击您的项目名称,然后转到团队并单击“添加到索引”。现在再次右键单击您的项目名称,然后转到团队并单击“提交”。现在您将看到 Git Staging 控制台已打开,您所做的更改开始显示在 Staged Changes 框中。

回答by Vignesh Raja

If it helps anyone, I ran into the same problem.

如果它对任何人有帮助,我就会遇到同样的问题。

During synchronization, in repository selection, the option Include local uncommitted changes in comparisonis not checked and shows No changes foundin the Synchronizeview. Synchronizing with that option checked, shown the changes.

在同步期间,在存储库选择中,选中包含本地未提交的更改比较选项并在同步视图中显示未找到更改。与选中的选项同步,显示更改。

Eclipse Version: Luna Service Release 1 (4.4.1) - MacOS

Eclipse 版本:Luna Service Release 1 (4.4.1) - MacOS

回答by BetaRide

We were strugeling with the same problem. It turned out that we had to remove all options in Git->Synchronize preferences.

我们正在为同样的问题苦苦挣扎。结果我们不得不删除 Git->Synchronize 首选项中的所有选项。

We are using Eclipse Juno and Kepler. Removing the options solved the problem for both.

我们正在使用 Eclipse Juno 和 Kepler。删除选项解决了两者的问题。