Eclipse / Egit,推送至远程菜单选项变灰 [英] Eclipse/Egit, Push to Remote menu choice is grayed out

查看:745
本文介绍了Eclipse / Egit,推送至远程菜单选项变灰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GitHub上创建了一个仓库。我使用Eclipse和Egit设置了一个本地git仓库。
使用团队>远程>推。我设法将本地仓库推送到GitHub上的仓库。



现在我预计可以使用 Team>作为一键式推送(和拉/取),推送到上游(以及从上游获取),但此菜单选项不可用(灰显)。我必须使用团队>远程>每次手动填写信息( ctrl + space 帮助)。

遵循这个,我创建了一个远程配置并从存储库视图推送,我可以看到列出的远程GitHub存储库在远程下,但仍然是团队>推送到上游命令在菜单中显示为灰色。



有人可以给我一个提示,告诉我可能做错了什么吗? / p>

解决方案

以下是我所做的工作,并且工作正常:


  1. 右键单击您的项目,在存储库视图中选择Team→ Show。您将切换透视图并位于Git存储库选项卡中。

  2. 右键单击远程并选择创建远程。对于远程名称,输入原点。点击确定。

  3. 点击更改。输入您的信息,就像您在初次推送时一样。点击保存。

您现在应该可以通过右键单击您的项目,然后选择Team&rar; Push to Upstream。 / p>

由于远程已添加到相关项目下,因此每个项目都可以有自己的上游来源,并且不会发生干扰(而窗口>首选项解决方案是全局设置) 。

根据你所做的描述,看起来你尝试过 - 但可能没有使用远程名称origin,这是绝对必要的。我偶然发现了这个解决方案。


I created a repository on GitHub. I set up a local git repository using Eclipse and Egit. With Team > Remote > Push. I managed to push the local repo to the one on GitHub.

Now I expected to be able to use the Team > Push to Upstream (as well as fetch from upstream) as a one-click push (and pull/fetch), but this menu choice is not available (grayed out). I have to use Team > Remote > Push to each time manually fill in the info (ctrl+space helps).

Following this, I created a remote configuration and pushed from the repositories view, and I can see the remote GitHub repository listed under Remotes but still the Team > Push to Upstream command is grayed out in the menu.

Could someone please give me a hint as to what I have may done wrong?

解决方案

Here's what I did and this worked fine:

  1. Right click your project, choose Team→Show in Repositories View. You will switch perspectives and be in the Git Repositories tab.
  2. Right-click "Remotes" and choose "Create Remote". For "Remote name", enter "origin". Click OK.
  3. Click Change. Enter your information as you did during your initial push. Click Save.

You should now be able to push by merely right-clicking on your project, then Team→Push to Upstream.

Because the remote was added under the project in question, each project can have its own upstream origin and they will not interfere (whereas the Window > Preferences solution is a global setting).

Based on your description of what you did, it appears you attempted this - but possibly did not use the name "origin" for the remote, which is absolutely necessary. I stumbled across this solution by pure chance.

这篇关于Eclipse / Egit,推送至远程菜单选项变灰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆