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

Re: [PATCH resend] make "git push" update origin and mirrors, "git push --mirror" update mirrors

From
Paolo Bonzini <bonzini@gnu.org>
Date
Apr 27, 2008, 07:23 UTC
Message-ID
<481429EB.70809@gnu.org>
In-Reply-To
<20080426170126.GC29771@spearce.org>
Show 5 quoted lines
> Sorry, I don't really see a use case behind this.  `git push` today
> will push to origin all branches that exist both locally and already
> on the remote.  If you want to push to multiple locations, just
> specify the other URLs in the remote.origin.url configuration list.
> Linus added support for that years ago.

I publish my topic branches (with --mirror) on my personal site, and the master and stable branches on savannah.gnu.org.

Show 5 quoted lines
>> Similarly, if a developer uses the integrator's repository but
>> wishes to publish his own mirror somewhere, he can just do "git push
>> --mirror".
> 
> Why not just have a remote named "my-mirror" and do `git push my-mirror`?

More precisely, it would be "git push && git push --mirror mirror". My previous patch to add remote.<foo>.mirror shortens it to eliminate the --mirror, but I cannot condense it in one remote because one is mirror and the other isn't.

I can do this, in other words:
> For example in egit I can publish to both
> the master egit tree (repo.or.cz/egit.git) and to my fork
> (repo.or.cz/egit/spearce.git).  I publish to the latter almost
> daily, and rebase even more often than that.

... just by choosing whether to work in a topic branch or in a repo that is already on git.sv.gnu.org, but from a single checked out tree. Like you guys, I have multiple places to push to -- and I want "git push" to DWIM.

Of course I have a git-mirror script that does it, but the use case seemed frequent enough to warrant the effort to provide it for other users too.

Replying to Junio:
> Configuring to push to multiple can already be done as you described, not
> having to have a special case code like this patch is certainly very
> attractive

I considered actually to change it to "push to every remote that has a push refspec", and adding code to "git clone" that added a push refspec for origin. This would simplify the magic, but I wasn't sure of the ramifications and of whether it would change the behavior of the default remote.

Paolo
Previous: Paolo BonziniNext: Paolo Bonzini
Message 23 of 74 in “make "git push" update origin and mirrors, "git push --mirror" update mirrors”
  1. make "git push" update origin and mirrors, "git push --mirror" update mirrorsPaolo Bonzini, Apr 26, 2008
  2. Shawn O. PearceApr 26, 2008
  3. Junio C HamanoApr 26, 2008
  4. Shawn O. PearceApr 27, 2008
  5. Shawn O. PearceApr 27, 2008
  6. Junio C HamanoApr 27, 2008
  7. Shawn O. PearceApr 27, 2008
  8. Junio C HamanoApr 27, 2008
  9. Paolo BonziniApr 27, 2008
  10. Jeff KingApr 28, 2008
  11. Paolo BonziniApr 28, 2008
  12. Jeff KingApr 28, 2008
  13. Jeff KingApr 28, 2008
  14. Paolo BonziniApr 28, 2008
  15. Johannes SchindelinApr 28, 2008
  16. Paolo BonziniApr 28, 2008
  17. Johannes SchindelinApr 28, 2008
  18. Shawn O. PearceApr 28, 2008
  19. Paolo BonziniApr 28, 2008
  20. Stephen R. van den BergApr 28, 2008
  21. Jeff KingApr 28, 2008
  22. Paolo BonziniApr 27, 2008
  23. Paolo BonziniApr 27, 2008
  24. 0/7 limit the usage of the default remote "origin" to the minimumPaolo Bonzini, Apr 28, 2008
  25. 1/7 add special "matching refs" refspecPaolo Bonzini, Apr 28, 2008
  26. 2/7 add push line in git-clonePaolo Bonzini, Apr 28, 2008
  27. 3/7 Add a --push option to "git-remote add"Paolo Bonzini, Apr 28, 2008
  28. 4/7 make "git push" update all push repositories.Paolo Bonzini, Apr 28, 2008
  29. 5/7 don't rely on zero-argument "git fetch" from within git pullPaolo Bonzini, Apr 28, 2008
  30. 6/7 warn on "git pull" without a given branch.<name>.remote valuePaolo Bonzini, Apr 28, 2008
  31. 7/7 make "git fetch" update all fetch repositoriesPaolo Bonzini, Apr 28, 2008
  32. Alex RiesenApr 28, 2008
  33. Paolo BonziniApr 28, 2008
  34. Alex RiesenApr 28, 2008
  35. Paolo BonziniApr 29, 2008
  36. Alex RiesenApr 29, 2008
  37. Andreas EricssonApr 29, 2008
  38. Paolo BonziniApr 29, 2008
  39. Johannes SchindelinApr 29, 2008
  40. Paolo BonziniApr 29, 2008
  41. Alex RiesenApr 29, 2008
  42. Paolo BonziniApr 29, 2008
  43. Andreas EricssonApr 29, 2008
  44. Paolo BonziniApr 29, 2008
  45. Andreas EricssonApr 29, 2008
  46. Paolo BonziniApr 29, 2008
  47. しらいしななこApr 29, 2008
  48. Alex RiesenApr 29, 2008
  49. Paolo BonziniApr 29, 2008
  50. Alex RiesenApr 29, 2008
  51. Paolo BonziniApr 29, 2008
  52. Alex RiesenApr 29, 2008
  53. Johannes SchindelinApr 29, 2008
  54. Jeff KingApr 29, 2008
  55. Junio C HamanoApr 29, 2008
  56. Paolo BonziniApr 30, 2008
  57. Johannes SchindelinApr 29, 2008
  58. Alex RiesenApr 29, 2008
  59. Junio C HamanoMay 1, 2008
  60. Paolo BonziniMay 6, 2008
  61. Paolo BonziniMay 14, 2008
  62. Junio C HamanoMay 14, 2008
  63. Paolo BonziniMay 14, 2008
  64. Junio C HamanoMay 14, 2008
  65. Paolo BonziniMay 14, 2008
  66. Junio C HamanoApr 30, 2008
  67. Paolo BonziniApr 30, 2008
  68. Jeff KingApr 29, 2008
  69. Alex RiesenApr 29, 2008
  70. Junio C HamanoApr 29, 2008
  71. Jeff KingApr 29, 2008
  72. Paolo BonziniApr 30, 2008
  73. Paolo BonziniApr 29, 2008
  74. Johannes SchindelinApr 29, 2008

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.