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

Re: Keeping a non-1:1 mirror in sync and keeping private branches

From
JDJan Danielsson <jan.m.danielsson@gmail.com>
Date
Jul 16, 2017, 13:42 UTC
Message-ID
<eb5e02da-662e-5561-7548-e50efba13dca@gmail.com>
In-Reply-To
<20170716101045.aslfct7g5vqfqnhi@sigill.intra.peff.net>
On 07/16/17 12:10, Jeff King wrote:
Show 17 quoted lines
>>    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).
   I don't think that's a problem.  Or rather, I'd be willing to try it
and see if it becomes a problem.
   That said; does "drop the pruning" mean simply removing "--prune"
from the remove update?  I did that, but it still deletes my test-branch
on push.  Is there an implicit pruning happening due to some
configuration option or the specific commands I'm using?
Show 5 quoted lines
>   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.
   This sounds very useful.  How would one go about setting up this
configuration?
-- 
Kind regards,
Jan Danielsson
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “Keeping a non-1:1 mirror in sync and keeping private branches”
  1. Jan DanielssonJul 16, 2017
  2. Jeff KingJul 16, 2017
  3. Jan DanielssonJul 16, 2017
  4. Jeff KingJul 16, 2017

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.