Re: Creating new remote branch in git?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Smith <greg(at)2ndQuadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Creating new remote branch in git?
Date: 2011-06-12 15:45:54
Message-ID: 201106121545.p5CFjsG04967@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Uh, I think someone needs to add this to our wiki:
>
> I did.

I saw your commit that mentioned how to create a new branch. My problem
was with using workdir:

http://wiki.postgresql.org/wiki/Committing_with_Git#Committing_Using_a_Single_Clone_and_multiple_workdirs

I had to use:

pggit config branch.REL9_1_STABLE.remote origin
pggit config branch.REL9_1_STABLE.merge refs/heads/REL9_1_STABLE

or I get errors like this during 'pull':

$ git-new-workdir postgresql/.git/ 8.2
Checking out files: 100% (3851/3851), done.

$ cd 8.2

$ git checkout -b REL8_2_STABLE origin/REL8_2_STABLE
Checking out files: 100% (3908/3908), done.
error: Not tracking: ambiguous information for ref refs/remotes/origin/REL8_2_STABLE
Switched to a new branch 'REL8_2_STABLE'

$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.REL8_2_STABLE.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

[branch "REL8_2_STABLE"]
remote = <nickname>
merge = <remote-ref>

[remote "<nickname>"]
url = <url>
fetch = <refspec>

See git-config(1) for details.

(Is that "error: Not tracking: ambiguous information" error harmless?)

Once I execute this:

$ git config branch.REL8_2_STABLE.remote origin
$ git config branch.REL8_2_STABLE.merge refs/heads/REL8_2_STABLE

'pull' then works:

$ git pull
Already up-to-date.

So my point is I don't think we document the need to either update
.git/config or run those commands. The pull error message suggests
updating .git/config, but ideally we should tell users how to set this
up.

Editing the config file was mentioned in this email thread:

http://archives.postgresql.org/pgsql-hackers/2011-06/msg00860.php

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2011-06-12 16:17:25 Re: WIP: collect frequency statistics for arrays
Previous Message Kevin Grittner 2011-06-12 14:59:42 Re: Small SSI issues