Re: [ITCH] Specify refspec without remote
- From
Jeff King <peff@peff.net>
- Date
- Mar 19, 2013, 10:02 UTC
- Message-ID
- <20130319100232.GA6120@sigill.intra.peff.net>
- In-Reply-To
- <CALkWK0=WCsXErHft9RbDOeehon7E2oCj5-YT6Ph+8bLFW-5JaQ@mail.gmail.com>
On Tue, Mar 19, 2013 at 03:28:12PM +0530, Ramkumar Ramachandra wrote:
Show 13 quoted lines
> > I think the ambiguity is a little more complex than that, because we > > cannot enumerate the universe of all remotes. Keep in mind that we can > > take either a configured remote or a URL (or ssh host). So what does: > > > > git push foo:bar > > > > mean? Is it pushing "refs/heads/foo" to "refs/heads/bar" on "origin"? Or > > is it using the default refspecs to push to the "bar" repo on the host > > "foo" over ssh? > > Wait, why does git-push support pushing to a URL directly? Shouldn't > the user be required to create a new remote out of the URL and push to > that? What happens to upstream branches if we directly push to a URL?
I do not recall the exact history, but I would not be surprised if git first learned to push to a URL, and later learned about configured remotes. I do not use it that often myself these days, but I find it occasionally useful for one-off pushes (e.g., pushing a normally private repo to a temporary publishing point to share with somebody else).
In that case, upstream branches are not touched at all (because we do not have a configured remote whose fetch refspec we can examine).
-Peff