Re: Creating new remote branch in git?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Creating new remote branch in git?
Date: 2011-06-13 22:38:46
Message-ID: 201106132238.p5DMckf26497@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:
>
>
> On 06/13/2011 02:26 PM, Bruce Momjian wrote:
> > I found the cause. When I added 'github' to ~/.gitconfig a few months
> > ago, I copied this line from .git/config:
> >
> > fetch = +refs/heads/*:refs/remotes/origin/*
> >
> > If this line is in ~/.gitconfig for both 'origin' and 'github', git
> > cannot create .git/config entries.
> >
> > Attached is my corrected ~/.gitconfig file. I now use only the 'url'
> > branch entries, which is all that is needed.
> >
> [...]
> > [remote "origin"]
> > url = ssh://git(at)gitmaster(dot)postgresql(dot)org/postgresql.git
> > # Do not add the next line or .git/config is not updated.
> > # fetch = +refs/heads/*:refs/remotes/origin/*
> > [remote "github"]
> > url = git(at)github(dot)com:bmomjian/postgres.git
>
>
> Is putting remotes in your ~/.gitconfig good practice? I certainly
> don't have any in mine.

Putting 'github' in there allows me to push/pull from github branches
without having to specify the github URL.

> The one for "origin" seems a particularly bad idea to me, although I
> don't claim that my git-fu is of the highest.

Yeah, it isn't necessary, but it does allow me to do:

git clone origin

again without having to specify the URL.

--
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 Andrew Dunstan 2011-06-13 23:00:16 Re: Creating new remote branch in git?
Previous Message Josh Berkus 2011-06-13 22:11:54 Re: creating CHECK constraints as NOT VALID