From: Junio C Hamano <gitster@pobox.com>
To: Dan Farina <drfarina@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: backup or mirror a repository
Date: Thu, 27 Sep 2007 23:27:06 -0700 [thread overview]
Message-ID: <7vsl4zqp8l.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1190947063.2263.46.camel@Tenacity> (Dan Farina's message of "Thu, 27 Sep 2007 19:37:43 -0700")
Dan Farina <drfarina@gmail.com> writes:
> I did look at prune and update, but my problem is the opposite: I want
> something that will remove branches from the remote repo when they no
> longer exist locally. As-is over time I will proliferate little local
> branches unless I occasionally sit down and delete branches by operating
> directly on the bare backup repository. (and then use prune on the
> remote nodes)
The "git remote add --mirror" setup is about setting up the
local repository _AS_ the backup of the remote. In other words,
the contents come from the remote by fetching from it and safely
kept away from disaster on the local side. And for that,
"remote prune" is a perfect thing to do.
I think what you are asking for is an opposite, a backup remote
site you would push into. That is not what "remote add --mirror"
is about.
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".
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.
next prev parent reply other threads:[~2007-09-28 6:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-27 19:35 backup or mirror a repository Dan Farina
2007-09-27 21:56 ` Johannes Schindelin
2007-09-28 0:51 ` Dan Farina
2007-09-28 1:56 ` Johannes Schindelin
2007-09-28 2:37 ` Dan Farina
2007-09-28 6:27 ` Junio C Hamano [this message]
2007-09-28 7:20 ` Dan Farina
2007-10-18 5:32 ` Dmitry Potapov
2007-10-30 0:33 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vsl4zqp8l.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=drfarina@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).