git - 如何在 EGit 中创建适当的新本地和远程分支组合?

标签 git egit

我想在 EGit 中执行以下操作:

$ git checkout -b newbranch
$ git push -u origin newbranch

这为我提供了一个新的本地分支,将其推送到上游服务器并创建正确的跟踪引用。我如何在 EGit 中执行相同的操作?

最佳答案

第一次操作可以看EGit手册《Creating a New Local Branch

Select Team > Switch To... > New Branch

new branch dialog

有关推送,请参阅 Vogella's Egit tutorial ,还有“Push ref specification

push a branch

备注:robinst已开通bug 378960 “允许在 Push Branch 向导中配置上游”(在“EGit - set up remote tracking correctly when creating a branch”中提到)。

The problem is that this (configuring the upstream on push) is not yet done automatically when first pushing a branch.

For now you have to right click on the branch in the Git Repositories view and choose "Configure Branch", where you can set up the upstream configuration.


备注:bug 378960已在 Egit 3.2 中标记为已解决(2014 年 2 月) :

Push Branch / Initial Push wizard simplifies pushing a branch and also allows upstream configuration for new branches created by the push operation:

https://wiki.eclipse.org/images/6/6f/Egit-3.2-PushBranchWizard.png

关于git - 如何在 EGit 中创建适当的新本地和远程分支组合?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10111236/

相关文章:

windows - Git 连接问题。 "fatal: unable to connect to github.com....."

Git reset --hard 并推送到远程仓库

eclipse - 撤消 egit 中单文件本地未提交的更改(例如 svn revert)

java - Egit 的 Eclipse 版本是什么?

git - Eclipse Git (EGit) 无法克隆 Git 存储库

git mv 不删除旧文件

git - git push 和 git push -f 的区别

Eclipse + Git - 如何获取工具栏?

git - eGit merge 解决方案 - 使用您的副本

git - 无法安装 docker