Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] [egit-dev] Pull vs. Rebase

We could certainly make this easier without needing to know all of the config specifics though?

Sent from my iPhone 4

On 11 May 2011, at 23:59, Matthias Sohn <matthias.sohn@xxxxxxxxxxxxxx> wrote:

2011/5/11 James Blackburn <jamesblackburn@xxxxxxxxx>
On 11 May 2011 21:55, Matthias Sohn <matthias.sohn@xxxxxxxxxxxxxx> wrote:
Currently the pull strategy can be configured when creating a new local branch based on a remote
tracking branch in the branch creation dialog mentioned in [1]. If you select the pull strategy "Rebase"
pull will do fetch + rebase (local branch onto updated remote tracking branch). 

It looks like this option only exists when creating a branch.  I couldn't figure out how to change it for an existing branch (master), or while using the File > Import > Git wizard.

This is a per-local-branch configuration, you may do that for already existing branches 
by adding the corresponding configuration entries e.g. by using the configuration 
editor under  "Preferences > Team > Git > Configuration" or by editing the 
.git/config file using your favorite test editor
 
You need the following entries for a local branch tracking a remote branch:
branch.<branchname>.remote=<remote used to define the upstream repository>
branch.<branchname>.merge=refs/heads/<remote branch in upstream repository to be tracked>
branch.<branchname>.rebase=true (to use rebase pull strategy)

e.g. if you are creating a local branch "featureX" which shall track changes coming from
the branch "stable-1.1" in the upstream repository through the remote "eclipse"
you need to add the following configuration entries:

branch.featureX.remote=eclipse
branch.featureX.merge=refs/heads/stable-1.1
branch.featureX.rebase=true

find more details by searching "branch.<name>." in [1]

the used origin of course must be defined, you may add missing definitions 
e.g. from repositories view by using the menu actions
"add remote", "configure fetch", "configure push" 

you need at least

remote.<remotename>.url="" used to reach upstream repository>
remote.<remotename>.fetch=<fetch refspec defining how to map branches from upstream to local repository when fetching>

optional : 
remote.<remotename>.pushurl=<url used to push changes to upstream, if missing "url" is used>
remote.<remotename>.push=<push refspec defining how to map local branches to branches in upstream repository when pushing>

for the example this could be:
remote.eclipse.url="" href="http://egit.eclipse.org/egit.git">egit.eclipse.org/egit.git
remote.eclipse.fetch=refs/heads/*:refs/heads/*
remote.eclipse.pushurl=ssh://joedev@xxxxxxxxxxxxxxxx:29418/egit.git
remote.eclipse.push=HEAD:refs/heads/master  (this would translate to pushing currently checked out branch to upstream master)


--
Matthias
_______________________________________________
egit-dev mailing list
egit-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/egit-dev

Back to the top