我想在 EGit 中执行以下操作:
$ git checkout -b newbranch
$ git push -u origin newbranch
这为我提供了一个新的本地分支,将其推送到上游服务器并创建正确的跟踪引用。我如何在 EGit 中执行相同的操作?
最佳答案
第一次操作可以看EGit手册《Creating a New Local Branch 》
Select Team > Switch To... > New Branch
有关推送,请参阅 Vogella's Egit tutorial ,还有“Push ref specification”
备注: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:
关于git - 如何在 EGit 中创建适当的新本地和远程分支组合?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10111236/