From: Jeff King Date: Wed, 16 Apr 2008 03:48:23 GMT Subject: Re: Friendly refspecs Message-ID: <20080416034823.GA11727@sigill.intra.peff.net> In-Reply-To: <20080413093102.GC12107@mithlond.arda.local> On Sun, Apr 13, 2008 at 12:31:02PM +0300, Teemu Likonen wrote: > There is still one thing (at least) that I don't quite understand. It's > about "git push". When I do > > $ git push > > the refs/heads/ is updated or created on the remote side. But if > I do > > $ git push : > > the refs/heads/ is not automatically created. Why there is need > to say ":refs/heads/" to make it work if > does not exist? The 'git push' manual says something vague about branch > not matching (?). What does it mean? This happens because "git push " is expanded locally to "git push :", but is first expanded into refs/heads/. The latter uses the explicit refspec which doesn't get expanded, since it doesn't exist at all, and so we can't deduce the type (e.g., refs/heads versus refs/tags). ISTR some discussion in the past few months about using the type of to guess the type of , but it seems not to have gone anywhere. Daniel, were you working on this? -Peff