From: Junio C Hamano Date: Mon, 16 Nov 2009 20:05:13 GMT Subject: Re: pushing remote branches Message-ID: <7vlji6p75y.fsf@alter.siamese.dyndns.org> In-Reply-To: Lorenzo Bettini writes: >> Anyway to answer your question, I do not see the refspec line as the issue >> here, but the URL for the repo, which determines how you access it. > > so this would have been enough: > >>> [remote "origin"] >>> fetch = +refs/heads/*:refs/remotes/origin/* >>> url = git://... >>> [branch "master"] >>> remote = origin >>> merge = refs/heads/master >>> [branch "experiments"] >>> remote = origin >>> merge = refs/heads/experiments Because "git://" is almost always read-only, you wouldn't be able to push back to the origin with that configuration. If you are only following the project that is perfectly fine. Otherwise, either use "git@..." in remote.origin.url to use git-over-ssh in both directions, or you can use pushurl if you have recent enough version of git, like: [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git://... pushurl = git@... When you primed your repository with "git clone git://...", it would be nice if "clone" added a "corresponding" pushurl for you. But ... part of the two lines are often different, depending on how hosting site is organized, so unfortunately "clone" cannot do so.