EGIT不添加origin github远程

发布于 2024-12-04 21:08:10 字数 1282 浏览 2 评论 0原文

为什么如果我创建一个本地存储库,然后创建一个 github 存储库,然后将其添加为远程存储库,我提交到本地,然后推送到远程,但我无法从远程拉取到本地?

如果我使用 git bash 添加远程,则所有远程都已正确配置,我可以拉取、推送和获取到上游,但如果我通过 EGIT 向导执行此操作,则它永远不适用于推送然后获取和合并的本地存储库。 .. 有什么线索吗?

这是日志帖子:

eclipse.buildId=I20110613-1736 java.version=1.6.0_26 java.vendor=Sun Microsystems Inc. BootLoader 常量:OS=win32、ARCH=x86、WS=win32、 框架参数:-product org.eclipse.epp.package.java.product 命令行参数:-os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product

错误 Tue Sep 20 10:40:05 BST 2011 当前分支不是 配置为拉动

org.eclipse.jgit.api.errors.InvalidConfigurationException:无值 对于在配置中找到的关键branch.master.merge org.eclipse.jgit.api.PullCommand.call(PullCommand.java:189) 在 org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:82) 在 org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) 在 org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326) 在 org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:104) 在 org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:115) 在 org.eclipse.egit.ui.internal.pull.PullOperationUI$1.run(PullOperationUI.java:90) 在 org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Why if I create a local repository, then create a github repository and then add that as remote, I commit to local and then I push to remote, but I have no ability to pull from remote to local?

If I add remote using git bash all is well remote is properly configured and I can pull, and push and fetch to upstream but if I do it thru the EGIT wizard it never works for local repositories that get pushed and then get fetched and merged...
Any clues?

Here is the log post:

eclipse.buildId=I20110613-1736 java.version=1.6.0_26 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32,
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product
org.eclipse.epp.package.java.product

Error Tue Sep 20 10:40:05 BST 2011 The current branch is not
configured for pull

org.eclipse.jgit.api.errors.InvalidConfigurationException: No value
for key branch.master.merge found in configuration at
org.eclipse.jgit.api.PullCommand.call(PullCommand.java:189) at
org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:82) at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)
at
org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:104)
at
org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:115)
at
org.eclipse.egit.ui.internal.pull.PullOperationUI$1.run(PullOperationUI.java:90)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

风吹过旳痕迹 2024-12-11 21:08:10

只需添加

    [branch "master"]
        remote = origin
        merge = refs/heads/master

到 .git/config 中
从 origin/master 拉入 master

simply add

    [branch "master"]
        remote = origin
        merge = refs/heads/master

into .git/config
to pull from origin/master into master

终止放荡 2024-12-11 21:08:10

您可以在“Git 存储库”选项卡中执行此操作。

窗口>显示视图>其他...>> git > Git 存储库

展开您的项目的存储库 >右键单击“遥控器”>创建远程...

You can do this in the "Git Repositories" tab.

Window > Show view > Other... > Git > Git Repositories

Expend your project's repository > Right click on "Remotes" > Create Remote...

几味少女 2024-12-11 21:08:10

对此有一个讨论,提供了建议的解决方案,并指出了 bugzilla 错误报告 http://www.eclipse.org/forums/index.php/m/683377/

简而言之,问题似乎是 Egit 系统不知道远程上的哪个分支对应于 eclipse 中的 master 分支,解决方案是将这些信息添加到配置文件中。

There's a discussion on this providing a proposed solution, and pointing to a bugzilla bug report at http://www.eclipse.org/forums/index.php/m/683377/ .

In short, the issue seems to be that the Egit system does not know which branch on the remote corresponds to the master branch in eclipse, and the solution is adding this info to a config file.

黎歌 2024-12-11 21:08:10

配置文件中的更改在我的情况下不起作用。

因此,我在初始推送后删除了本地项目,然后进行了拉取。现在一切都很好。

The change in the config file didnt work in my case.

So I deleted the local project after the initial push and did a pull afterwards. Now everything's fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文