Re: git pull and merging.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 6, 2006, 09:26 UTC
- Message-ID
- <Pine.LNX.4.63.0612061019350.28348@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <cc723f590612052121u1f6e3c9lc7329f40ee1c9e5a@mail.gmail.com>
Hi,
On Wed, 6 Dec 2006, Aneesh Kumar wrote:
Show 14 quoted lines
> On 12/6/06, Junio C Hamano <junkio@cox.net> wrote: > > > $ cat >.git/remotes/origin <<\EOF > > URL: ...kernel.org/pub/scm/git/git.git > > Pull: refs/heads/master:refs/remotes/origin/master > > Pull: refs/heads/next:refs/remotes/origin/next > > Pull: +refs/heads/pu:refs/remotes/origin/pu > > EOF > > Okey what i was looking for was a .git/config that will imply as a > part of git pull origin that local > > master is to track remotes/origin/master > pu should track remotes/origin/pu.
You can have the same effect as what Junio wrote with the config:
$ git repo-config remote.origin.url git://git.kernel.org/pub/scm/git/git.git $ git repo-config remote.origin.fetch \ refs/heads/master:refs/remotes/origin/master $ git repo-config remote.origin.fetch \ refs/heads/next:refs/remotes/origin/next ^$ $ git repo-config remote.origin.fetch \ +refs/heads/pu:refs/remotes/origin/pu ^$
But if you clone with recent git, that will already be set up for you (well, except that the "+" is missing in front of the "pu" thing, which says that it is okay if that particular ref is not fast-forwarding).
> I almost felt the branch.<name>.merge was for that.
No. This tells git which _default_ branch to merge with. I.e.
$ git repo-config branch.master.remote origin $ git repo-config branch.master.merge next
means that if your current branch is "master", a "git pull" _without_ parameters will default to the branch "next" of the remote "origin" you just set up like above.
Hth, Dscho