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?
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With