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

Re: backup or mirror a repository

From
Dan Farina <drfarina@gmail.com>
Date
Sep 28, 2007, 07:20 UTC
Message-ID
<1190964003.31911.13.camel@Tenacity>
In-Reply-To
<7vsl4zqp8l.fsf@gitster.siamese.dyndns.org>
On Thu, 2007-09-27 at 23:27 -0700, Junio C Hamano wrote:
Show 7 quoted lines
> You can almost do it with
> 
> 	git push --all $remote
> 
> except there is no way to automagically remove the branch you
> removed from the local repository.  For that, we would need a
> new --mirror option to "git-push".

Yup! I actually was looking for such a thing in the git-push man page, but was unsuccessful. I was living with git-push --all for a little while before I thought I'd ask. Unfortunately, the preferred setup (having the backup machine actively perform fetch and prune) is not very nice for me due to firewalls.

Show 11 quoted lines
> 
> I think it is trivial to do for native transports, as we first
> get the list of all refs from the remote side before starting
> the transfer.  You need to change the last parameter called
> 'all' to remote.c::match_refs() into an enum ('push_all' being
> one of choices), introduce another enum 'push_mirror', and teach
> it to "match" the remote (i.e. dst) ref that does not have
> corresponding entry on our side (i.e. src) with an empty object
> name to mark it removed.  Then the part marked as "Finally, tell
> the other end!"  in send-pack.c::send_pack() will take care of
> the actual removal.

I should have a look, but if someone else wants to work on this they shouldn't block on me: work already made me get hit by a bus on one project (luckily I wasn't important), and the storm is not over.

Thanks, fdr

Previous: Junio C HamanoNext: Dmitry Potapov
Message 7 of 9 in “backup or mirror a repository”
  1. Dan FarinaSep 27, 2007
  2. Johannes SchindelinSep 27, 2007
  3. Dan FarinaSep 28, 2007
  4. Johannes SchindelinSep 28, 2007
  5. Dan FarinaSep 28, 2007
  6. Junio C HamanoSep 28, 2007
  7. Dan FarinaSep 28, 2007
  8. Dmitry PotapovOct 18, 2007
  9. Johannes SchindelinOct 30, 2007

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.