Eclipse/Egit,推送到远程菜单选项呈灰色
我在 GitHub 上创建了一个存储库。我使用 Eclipse 和 Egit 设置了本地 git 存储库。 与团队>远程>推。我设法将本地存储库推送到 GitHub 上的存储库。
现在我希望能够使用 Team >作为一键推送(和拉取/获取)推送到上游(以及从上游获取),但此菜单选项不可用(灰显)。我必须使用
Team >远程>每次手动填写信息时按下
(ctrl+空格帮助)。
接下来此,我创建了一个远程配置并从存储库视图中推送,我可以看到 < 下列出的远程 GitHub 存储库code>Remotes 但仍然是Team >推送到上游命令在菜单中呈灰色显示。
有人可以给我一个提示,告诉我我可能做错了什么吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这就是我所做的,效果很好:
现在,您应该只需右键单击您的项目,然后选择“团队”→“推送到上游”即可进行推送。
因为远程是在相关项目下添加的,所以每个项目都可以有自己的上游源,并且它们不会干扰(而“窗口”>“首选项”解决方案是全局设置)。
根据您对所做操作的描述,您似乎尝试了此操作 - 但可能没有使用遥控器的名称“origin”,这是绝对必要的。我偶然发现这个解决方案纯属偶然。
Here's what I did and this worked fine:
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.
我遇到了这个问题,幸运的是找到了一种重新启用“推送到上游”选项的方法。
remote.origin.url
也许有一种更巧妙的方法可以实现同样的目标。一旦我到达这里,我就停止寻找,因为它现在可以工作了。
I had this problem and thankfully found a way to re-enable the "Push to Upstream" option.
remote.origin.url
Perhaps there is a neater way of achieving the same thing. Once I reached this far I stopped looking because it works now.
您需要在该存储库的
.git/config
文件中进行以下类型的配置:remote
设置可以是您的任何遥控器,也可以只是的值。
您可以通过从 Git 存储库 视图中存储库的上下文菜单中选择属性 菜单项来编辑存储库的配置。
You need to have the following type of configuration in that repository's
.git/config
file:The
remote
setting can be any of your remotes or just a value of.
You can edit the repository's config by selecting the Properties menu item from the context menu for the repository in the Git Repositories view.
我来这里寻找解决方案来解决与 bitbucket 类似的问题 - 尽管两个最高票数的答案都不适合我,但它证明我有选项“放置分支...”,当我尝试这样做时,它说“非快进”,但是当我成功进行“拉”时,我能够推到上游。
也许它会对某人有所帮助:)
I came here searching for solution to solve similar problem with bitbucket - although none of the two highest votes answer didn't work for me, it proved that I had option "Put branch...", when I tried to do this, it says "Non fast-forward", but when I successfully made "pull", I was able to push to upstream.
Maybe it will help someone :)
这篇文章可能有点旧,但我的一个存储库也有同样的问题,此链接中的以下信息对我有用:向现有 git 存储库添加远程
我想从该文章中强调的部分如下:
当我在 .git/config 中进行更改时,刷新了日食“推到上游”链接对我有用。请记住,我假设您在 Git 透视图中为远程存储库配置了远程。
This post might be a little old, but I had the same issue with one of my repos the following information from this link worked for me: Adding a remote to an existing git repo
The part i want to highlight from that article is the following:
When I made the change in the .git/config and refreshed eclipse the "push to upstream" link worked for me. Keep in mind, I am assuming that you have a remote configured in your Git perspective for your remote repository.
就我而言,所有 git commit/push 操作均处于非活动状态。我通过将存储库文件夹放在 git 目录下解决了这个问题。
In my case all git commit/push operations are inactive. I fixed the issue by placing the repository folder under git directory.