Re: Creating new remote branch in git?
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Bruce Momjian <bruce@momjian.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Greg Smith <greg@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2011-06-13T23:00:16Z
Lists: pgsql-hackers
On 06/13/2011 06:38 PM, Bruce Momjian wrote: > 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@gitmaster.postgresql.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@github.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. Well, TIMTOWTDI, but I suspect you'd be much better off using git aliases for both these purposes. Then you would not have got yourself into the trouble that gave rise to this conversation. cheers andrew