“推...”和“推...”有什么区别?和“推向上游...”在日食中
在 Eclipse 中使用“推送到上游...”时,新的“本地”提交将被推送到远程存储库,并且远程分支引用会在本地存储库中更新(因此 master
和 origin /master
引用相同的提交)。
当使用“Push...”并在向导窗口中添加对 master 的推送引用 (refs/heads/*
) 时,新的“本地”提交将被推送到远程存储库(像以前一样),但是远程分支引用未在本地存储库中更新(因此 master
引用了最后一次提交,但 origin/master
未移动)。
这两种工作方式有什么区别?它对于特定的分散工作流程有用吗? 这两种方法对应的git命令是什么?
When using "Push to upstream..." in Eclipse, the new "local" commits are pushed to remote repository and the remote branch ref is updated in the local repository (so master
and origin/master
reference the same commit).
When using "Push..." and adding a push ref on master in the wizard window (refs/heads/*
), the new "local" commits are pushed to remote repository (like previously) but the remote branch ref is not updated in the local repository (so master
reference the last commit but origin/master
didn't moved).
What's the difference between these two ways of working? Is it useful for particular decentralized work flows?
What would be the corresponding git commands of these two approaches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
推送到上游..按照您对远程跟踪分支的期望推送您的分支。
Push... 打开一个对话框,让您指定应该推送哪些 refspec,包括标签、特殊情况,如 HEAD:refs/heads/master 等。
它不更新 origin/master 对我来说似乎是一个错误,或者他们可能正在等待下一次获取来更新源。我会在 https://bugs.eclipse.org/bugs/enter_bug 打开一个错误.cgi?product=Egit&component=UI
密码
Push to Upstream.. pushes your branch as you would expect for a remote-tracking branch.
Push... opens a dialog and lets you specify which refspecs you should push up, including tags, special cases like HEAD:refs/heads/master, etc.
That it doesn't update origin/master seems like a bug to me, or maybe they're waiting for the next fetch to update origin. I'd open a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EGit&component=UI
PW
按照 Paul 的建议,我在 EGit 的 Bugzilla 上打开了一个 bug 并得到了那里有解释。
当使用“Push...”时,EGit PushWizard 使用存储库 URI(而不是它们的名称)调用 JGit 的命令。这就是 JGit 无法更新远程跟踪分支的原因。
该错误仍然处于开放状态,因此我们可能希望在未来的版本中,从“配置的远程存储库”完成的“推送...”将更新远程跟踪分支。
As suggested by Paul, I opened a bug on EGit's Bugzilla and got an explanation there.
When "Push..." is used, the EGit PushWizard calls JGit's command with the repositories URIs, not their names. That's why JGit cannot update remote tracking branch.
The bug is still Open so we may hope that in a future release, "Push..." done from a "Configured remote repository" will update remote tracking branch.
可以从
Git 存储库 或
Package Explorer
视图,但您必须选择正确的选项。从
Git Repositories
视图:Push
Next
或
Remotes
文件夹。origin
配置推送...
高级
按钮(您也可以展开
origin
,然后右键单击Push
并转到Configure Push...
,然后按Advanced
按钮)从
Package Explorer
> 查看团队
->远程
->推
->下一步
(相当于按上述步骤中的“高级”按钮。)或
团队
->远程
->配置推送到上游...
Extra settings with push are available from either the
Git Repositories
orPackage Explorer
views, but you must choose the correct option.From
Git Repositories
view:Push
Next
OR
Remotes
folder.origin
Configure Push...
Advanced
button(You can also expand
origin
then right-click onPush
and go toConfigure Push...
then press theAdvanced
button)From the
Package Explorer
viewTeam
->Remote
->Push
->Next
(equivalent to pressing the "Advanced" button in the steps above.)OR
Team
->Remote
->Configure Push to Upstream...