git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Multiple push remotes via aliases

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
May 10, 2015, 19:10 UTC
Message-ID
<20150510191045.GD225482@vauxhall.crustytoothpaste.net>
In-Reply-To
<xmqq4mnkgtj0.fsf@gitster.dls.corp.google.com>
On Sun, May 10, 2015 at 11:46:27AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > I recently discovered that it was possible to specify multiple push URLs
> > for a remote.  This is useful for me because some of my projects live
> > both on GitHub and on my own server, and some live only one place or the
> > other.
> >
> > One feature that I'm looking for, however, is the ability to specify
> > those URLs by reference to another remote.
> 
> Two issues that immediately comes to my mind are
> 
>  (1) how you deal with a misconfiguration that makes a loop;

I was certain you were going to ask this. My plan is to only allow one level of reference as a first pass and check for the current remote name. If there's a desire to extend it to multiple levels, we can implement loop checking then. A list of already-seen entries could be used in that case.

>  (2) how would you disambiguate a local directory and a nickname.
I was going to do something like this:
[remote "def"]
	reference = upstream
	reference = gh

The same rules for "def" would apply that are currently used, and "upstream" and "gh" would clearly be references, not remote URLs.

I had planned to essentially make "git push def" work like "git push upstream; git push gh", forbidding fetch and push entries at the same time as reference entries. Future work could use referenceURL to refer only to the URL and allow fetch and push to be used.

I'm also going to update the documentation to reflect that multiple push URLs can be specified, as it seems that's a well-kept secret.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Junio C HamanoNext: Michael Haggerty
Message 3 of 4 in “Multiple push remotes via aliases”
  1. brian m. carlsonMay 10, 2015
  2. Junio C HamanoMay 10, 2015
  3. brian m. carlsonMay 10, 2015
  4. Michael HaggertyMay 11, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.