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

Re: Separate default remotes for pulling and pushing

From
Jeff King <peff@peff.net>
Date
May 9, 2011, 22:06 UTC
Message-ID
<20110509220638.GB3719@sigill.intra.peff.net>
In-Reply-To
<53DAF1E7-9906-4BF4-A64B-FE16BF5977F5@gmail.com>
On Mon, May 09, 2011 at 12:01:53PM -0700, David Lee wrote:
Show 22 quoted lines
> > But now we have precedence questions. If I have config like:
> > 
> >  [push]
> >    defaultRemote = my-mirror
> > 
> >  [branch "foo"]
> >    remote = origin
> >    merge = refs/heads/master
> > 
> > which remote should be the default for "git push"? Obviously if I'm not
> > on "foo", it should be my-mirror. But if I am, should push.defaultRemote
> > take precedence? Should there also be a branch.*.pushRemote config that
> > takes precedence over branch.*.remote?
> > 
> > I have to admit that I have never found the branch.*.remote config to be
> > useful for any of my workflows, so I am not really sure how people use
> > it.
> 
> What about removing the branch.*.remote config by default, and if it's
> not set, then it defaults to whatever the repo-wide setting is for
> defaultRemote? Then a branch.*.remote would override the
> defaultRemote, and a branch.*.pushRemote would again override that.

The branch.*.remote config does much more, though. For example, it is part of the "upstream" branch config. So getting rid of it is definitely not an option.

-Peff
Previous: David LeeNext: Junio C Hamano
Message 7 of 14 in “Separate default remotes for pulling and pushing”
  1. David LeeMay 7, 2011
  2. Sverre RabbelierMay 7, 2011
  3. Jeff KingMay 9, 2011
  4. David LeeMay 9, 2011
  5. Jeff KingMay 9, 2011
  6. David LeeMay 9, 2011
  7. Jeff KingMay 9, 2011
  8. Junio C HamanoMay 9, 2011
  9. Jeff KingMay 9, 2011
  10. Junio C HamanoMay 9, 2011
  11. Jeff KingMay 10, 2011
  12. Jay SoffianMay 10, 2011
  13. Jeff KingMay 10, 2011
  14. Jay SoffianMay 10, 2011

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.