“推...”和“推...”有什么区别?和“推向上游...”在日食中

发布于 2024-12-25 13:44:45 字数 375 浏览 3 评论 0原文

在 Eclipse 中使用“推送到上游...”时,新的“本地”提交将被推送到远程存储库,并且远程分支引用会在本地存储库中更新(因此 masterorigin /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 技术交流群。

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

发布评论

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

评论(3

猫九 2025-01-01 13:44:45

推送到上游..按照您对远程跟踪分支的期望推送您的分支。

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

眼眸印温柔 2025-01-01 13:44:45

按照 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.

混吃等死 2025-01-01 13:44:45

Push... 打开一个对话框,让您指定应该推送哪些参考规范,包括标签、特殊情况,如 HEAD:refs/heads/master 等。

可以从 Git 存储库 或 Package Explorer 视图,但您必须选择正确的选项。

Git Repositories 视图:

  1. 右键单击存储库的名称。
  2. 选择Push
  3. 单击Next

  1. 展开Remotes 文件夹。
  2. 右键单击origin
  3. 选择配置推送...
  4. 单击高级按钮

(您也可以展开origin,然后右键单击 Push 并转到 Configure Push...,然后按 Advanced 按钮)

Package Explorer > 查看

  1. 右键单击​​项目文件夹(最上面的项目)。
  2. 团队 -> 远程 -> -> 下一步(相当于按上述步骤中的“高级”按钮。)

  1. 右键单击项目文件夹(最上面的项目)。
  2. 团队 -> 远程 -> 配置推送到上游...

Push... opens a dialog and lets you specify which refspecs you should push up, including tags, special cases like HEAD:refs/heads/master, etc.

Extra settings with push are available from either the Git Repositories or Package Explorer views, but you must choose the correct option.

From Git Repositories view:

  1. Right-click the name of the repo.
  2. Choose Push
  3. Click Next

OR

  1. Expand the Remotes folder.
  2. Right-click on origin
  3. Choose Configure Push...
  4. Click the Advanced button

(You can also expand origin then right-click on Push and go to Configure Push... then press the Advanced button)

From the Package Explorer view

  1. Right-click on the project folder (top most item).
  2. Team -> Remote -> Push -> Next (equivalent to pressing the "Advanced" button in the steps above.)

OR

  1. Right-click on the project folder (top most item).
  2. Team -> Remote -> Configure Push to Upstream...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文