git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jan Danielsson <jan.m.danielsson@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Keeping a non-1:1 mirror in sync and keeping private branches
Date: Sun, 16 Jul 2017 06:10:45 -0400	[thread overview]
Message-ID: <20170716101045.aslfct7g5vqfqnhi@sigill.intra.peff.net> (raw)
In-Reply-To: <699d0274-285f-3d30-654d-d9ca59fe4dce@gmail.com>

On Sun, Jul 16, 2017 at 02:59:23AM +0200, Jan Danielsson wrote:

>    This seems to accomplish everything I want except that the the "git
> push" deletes any branches I have created on my self-hosted
> repository.

A mirrored push is basically:

  - push all refs, i.e., a "+refs/*:refs/*" refspec

  - enable --prune, to delete any branches that don't exist on the local
    side

But you can do those two things separately if you like.  So your options
are either:

  1. Drop the pruning (in which case deleted branches from the sync may
     accumulate, but depending on the patterns that may or may not be a
     problem).

  2. Use two different namespaces for the synced branches and the
     private ones (e.g., refs/mirror/* in addition to your branches in
     refs/heads/*). The obvious downside is that anybody cloning your
     downstream mirror doesn't pick up refs/mirror unless they configure
     that refspec explicitly.

-Peff

  reply	other threads:[~2017-07-16 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-16  0:59 Keeping a non-1:1 mirror in sync and keeping private branches Jan Danielsson
2017-07-16 10:10 ` Jeff King [this message]
2017-07-16 13:42   ` Jan Danielsson
2017-07-16 14:16     ` Jeff King

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=20170716101045.aslfct7g5vqfqnhi@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jan.m.danielsson@gmail.com \
    /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).