21

In EGit when I got to Team > Switch to > New branch I end up with the dialog box below. What is the meaning of the various pull strategies listed on this dialog box?

enter image description here

ams
  • 60,316
  • 68
  • 200
  • 288

1 Answers1

17

Take a look at this from here :

enter image description here

From the above link :

The "Pull Strategy" group is only visible when a branch is selected in the combo and allows to override the default setup for the "upstream configuration" which is helpful when fetching and pushing, but particularly when pulling. Depending on the selected option the following configuration can be chosen:

Rebase: When pulling, new changes will be fetched from upstream and the remote tracking branch will be updated. Then the current local branch will be rebased onto the updated remote tracking branch

Merge: When pulling, the changes will be fetched from upstream and the remote tracking branch will be updated. Then the current local branch will be merged with the new changes. This is the default if the new branch is based on a remote tracking branch (but this default may be overridden by specific repository configuration)

None: When pulling, no specific upstream configuration will be done for the new branch; however, if a default remote exists (a remote with name "origin", pull will try to use the configuration of this remote; this is the default if the new branch is not based on a remote tracking branch

Command Line Equivalents

I think, the command line equivalent's of the above would be as follows:

Rebase

git fetch   //This updates the remote-tracking-branch such as remotes/origin/master    
git rebase remotes/origin/master

Merge

git fetch   // This updates the remote-tracking-branch such as remotes/origin/master
git merge remotes/origin/master

Having written that, my knowledge of GIT does not make me confident of the above.

Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91
  • FWIW, since this is a *pull strategy*, it would be run for the branch you are on, so no need for `checkout`. Also, `git pull` is a shortcut (if you will) for the *merge* strategy and `git pull --rebase` is a shortcut for the rebase strategy. – Roman Aug 14 '12 at 15:58
  • I would suggest you use rebase as default and do no-rebase from command line only when you have large merge commits. – Abhinav Manchanda Aug 22 '12 at 19:16