How to create a new remote branch with EGit?

Above picture Above · May 13, 2013 · Viewed 20.7k times · Source

Let's say I have an Eclipse Project which uses versioning control with EGit and is connected with a remote repository [email protected]:git2013. In my project, under the local branch newstuff, I create and change some files. Now, I want to push this to a remote branch named newstuff in my remote repository. But my remote repository only holds a branch master.

How do I create a new remote branch called newstuff?

PS: Please do not answer with command-line git commands; describe how to do it in EGit.

Answer

robinst picture robinst · Jan 30, 2014

In EGit 3.2, there is now a dedicated wizard for this use case:

  1. Select TeamPush Branch... in the context menu

  2. In the wizard, you can change which remote you want to push to and whether pulling on this branch should merge or rebase:

    Push Branch in EGit

  3. The next page will show a confirmation before doing the push, you can then finish the wizard.

After that, you can simply use Push to Upstream when the branch is checked out to push to the remote branch, or Pull to get the changes from the remote branch.