1

I want to do the following things with EGit: - create a new local branch - push it to a remote repository

Now, I'm a bit confused with all these options in the dialog for creating a branch. I'm not sure whether it should refer to any remote branch (as it will become remote itself and then my local branch should be linked to this newly created remote branch). And I still don't get the different pull strategies (what is default if a branch is created at the commandline and when is it recommended to use the others?)

I've already found instructions on how to do the second step but I'm not sure about the first one. Could anybody help? (with a configured screenshot of the dialog would be perfect....)

robinst
  • 30,027
  • 10
  • 102
  • 108
Antje Janosch
  • 1,154
  • 5
  • 19
  • 37

1 Answers1

1

This is how it works using EGit 3.2:

  1. Create the local branch using the context menu TeamSwitch ToNew Branch...

  2. In the dialog, enter the name of the branch. You don't want to configure it for push/pull with master, as we'll do that when pushing the branch to the remote. Finish the wizard:

    Create Branch in EGit

  3. Push the current branch as a new remote branch using TeamPush Branch...

  4. You can now choose whether you want to rebase or merge your local commits when pulling on this branch:

    Push Branch in EGit

  5. The next page will show a confirmation page before the push is done, then you can 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.

Community
  • 1
  • 1
robinst
  • 30,027
  • 10
  • 102
  • 108
  • I'll mark this as accepted answer though I cannot check it as my Egit version is 2.3 (I have to use Eclipse Indigo). – Antje Janosch Jan 31 '14 at 10:13
  • The dialog of the first step (creating the local branch) should look similar in 2.3. – robinst Jan 31 '14 at 11:32
  • Why not just selecting "Configure upstream for push and pull" in the first dialog? The tooltip says "This will connect the local branch with its remote branch for pushing and pulling". Doesn't it mean that the new remote branch is created and connected with the new local one? – Simon Feb 19 '20 at 13:46