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 <remote> <branch> > > the refs/heads/<branch> is updated or created on the remote side. But if > I do > > $ git push <remote> <branch1>:<branch2> > > the refs/heads/<branch2> is not automatically created. Why there is need > to say "<branch1>:refs/heads/<branch2>" to make it work if <branch2> > does not exist? The 'git push' manual says something vague about branch > not matching (?). What does it mean? This happens because "git push <remote> <branch>" is expanded locally to "git push <remote> <branch>:<branch>", but <branch> is first expanded into refs/heads/<branch>. The latter uses the explicit refspec <branch2> 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 <branch1> to guess the type of <branch2>, but it seems not to have gone anywhere. Daniel, were you working on this? -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html