How do I create a proper new local and remote branch combination in EGit?

核能气质少年 提交于 2019-12-04 09:21:38

问题


I would like to do the following in EGit:

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

This gives me a new local branch, pushes it to the upstream server and creates the right tracking reference. How do I do the same in EGit?


回答1:


For the first operation, you can read the EGit manual "Creating a New Local Branch "

Select Team > Switch To... > New Branch

For the push, see Vogella's Egit tutorial, but also the "Push ref specification"

Note: robinst has opened bug 378960 "Allow to configure upstream in Push Branch wizard" (mentioned in "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.


Note: bug 378960 has been marked as resolved (February 2014) in Egit 3.2:

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



来源:https://stackoverflow.com/questions/10111236/how-do-i-create-a-proper-new-local-and-remote-branch-combination-in-egit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!