Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of pull strategy when creating a branch with egit?

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

like image 476
ams Avatar asked Aug 14 '12 15:08

ams


People also ask

What exactly git pull does?

The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content. Merging remote upstream changes into your local repository is a common task in Git-based collaboration work flows.

Does git pull work on branches?

git pull is a Git command used to update the local version of a repository from a remote. It is one of the four commands that prompts network interaction by Git. By default, git pull does two things. Updates the remote tracking branches for all other branches.

What is default git pull strategy?

In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD . More precisely, git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch.


1 Answers

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.

like image 141
Ashutosh Jindal Avatar answered Nov 11 '22 13:11

Ashutosh Jindal