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

[PATCH 0/3] better "remote add --mirror" semantics

From
Jeff King <peff@peff.net>
Date
Mar 30, 2011, 19:51 UTC
Message-ID
<20110330195139.GA814@sigill.intra.peff.net>
In-Reply-To
<20110330145908.GA812@sigill.intra.peff.net>
On Wed, Mar 30, 2011 at 10:59:08AM -0400, Jeff King wrote:
Show 22 quoted lines
> All of that being said, I'm not sure your config makes sense:
> 
> > [remote "origin"]
> >         fetch = +refs/heads/*:refs/remotes/origin/*
> >         url = ssh://myserver.com/srv/git/myproject.git
> > [remote "mirror"]
> >         url = ssh://chris@myserver.com/srv/git/mirrors/chris/myproject.git
> >         fetch = +refs/*:refs/*
> >         mirror = true
> 
> Your mirror is configured to overwrite everything in refs/ if you fetch
> from it. Meaning it will throw away anything you fetched from "origin",
> as well as any local work. So this config is probably not what you want.
> 
> I'm guessing what you really wanted is a remote only for pushing to, and
> created it with:
> 
>   git remote add --mirror mirror ssh://...
> 
> The --mirror option has problems with that case. See this thread:
> 
>   http://article.gmane.org/gmane.comp.version-control.git/161653

Here is a patch series which I think improves the situation. +cc Jan Hudec from the mentioned thread.

  [1/3]: remote: disallow some nonsensical option combinations
  [2/3]: remote: separate the concept of push and fetch mirrors
  [3/3]: remote: deprecate --mirror
-Peff
Previous: Jeff KingNext: Jeff King
Message 3 of 13 in “checkout new branch tracks wrong remote (bug?)”
  1. chrisMar 30, 2011
  2. Jeff KingMar 30, 2011
  3. 0/3 better "remote add --mirror" semanticsJeff King, Mar 30, 2011
  4. 1/3 remote: disallow some nonsensical option combinationsJeff King, Mar 30, 2011
  5. 2/3 remote: separate the concept of push and fetch mirrorsJeff King, Mar 30, 2011
  6. Junio C HamanoMar 30, 2011
  7. Jeff KingMar 30, 2011
  8. Junio C HamanoMar 30, 2011
  9. chrisMar 31, 2011
  10. chrisMar 31, 2011
  11. Junio C HamanoMar 31, 2011
  12. chrisMar 31, 2011
  13. 3/3 remote: deprecate --mirrorJeff King, Mar 30, 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.