From: Nguyen Thai Ngoc Duy Date: Mon, 07 Feb 2011 10:22:26 GMT Subject: Re: [1.8.0] Provide proper remote ref namespaces Message-ID: In-Reply-To: <201102071106.17269.johan@herland.net> On Mon, Feb 7, 2011 at 5:06 PM, Johan Herland wrote: > On Monday 07 February 2011, Sverre Rabbelier wrote: >> On Mon, Feb 7, 2011 at 09:58, Johan Herland wrote: >> > This is the same technique we use when talking about branch names: >> > On this mailing list, nobody is confused when I refer to 'maint', >> > 'master', 'next' and 'pu'. Still, in our own work repos (at least >> > in mine), these branches are actually called >> > "refs/remotes/origin/" (commonly referred to by their >> > shorthands "origin/"). Here we are, juggling the same kind of >> > namespaces that I propose for tags, and it seems to work well >> > without causing much confusion. >> >> With the difference that you can't refer to "maint" as just "maint" >> unless you've created "refs/heads/maint" iff it is unambiguous. > > Except that with 'git checkout', you can: > > $ git clone git://git.kernel.org/pub/scm/git/git.git > $ cd git/ > $ git checkout maint That's some checkout magic kicking in. I cloned and there was only refs/heads/master. After checkout, refs/heads/maint appeared. $ git clone git://git.kernel.org/pub/scm/git/git.git git2 $ cd git2 $ git rev-parse maint maint fatal: ambiguous argument 'maint': unknown revision or path not in the working tree. Use '--' to separate paths from revisions $ git rev-parse origin/maint 597a63054241c122515c93cbce45bc44eb231f18 $ git co maint Branch maint set up to track remote branch maint from origin. Switched to a new branch 'maint' $ git rev-parse maint 597a63054241c122515c93cbce45bc44eb231f18 -- Duy