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

Re: mirroring and development with three levels of repositories?

From
John Clemens <clemej@gmail.com>
Date
Sep 28, 2010, 18:27 UTC
Message-ID
<AANLkTin2UPUPn5Sr=7dqT5bxFB7a-BYFzJhGV74r6taF@mail.gmail.com>
In-Reply-To
<20100928173710.GA31419@nibiru.local>
On Tue, Sep 28, 2010 at 1:37 PM, Enrico Weigelt <weigelt@metux.de> wrote:
Show 22 quoted lines
> * John Clemens <clemej@gmail.com> wrote:
>
>> Short question:
>> It it possible for a bare repository to have both local (company-wide) and
>> remote (mirroring upstream) branches, as well as serving those branches to our
>> devs? If so, how?
>
> Yes. Just set up the proper remotes in the config files (same as w/
> non-bare repos). The main problem for you might be that the hub-repo's
> remotes wont show up as remotes in it's clones - that's because per
> default only remote's refs/heads/* namespace is mapped into local's
> refs/remotes/*.
>
> Most convenient would probably doing this in the local hub repo.
> Add a proper fetch statement in the upstream remote's config section.
> Suppose the upstream's remote name is "origin":
>
>
> [remote "origin"]
>    url = ...
>    fetch = +refs/heads/*:refs/heads/origin/*
>    fetch = +refs/tags/*:refs/tags/origin/*

Hmm.. I do actually see the branches on dev machine. When I clone from our local mirror, everything works fine UNTIL I create a new branch and push it to our local mirror. From that moment on, all new clones fail (more precisely, they do download all the blobs, but the refs only point to the newly created branches, and HEAD is messed up.

config on the local mirror is this:
[remote "origin"]
        fetch = +refs/*:refs/*
        mirror = true
        url = xxx
presumably, fetch is recursive, so this should catch everything from upstream?

So, the problem appears to be that creating a new branch in the local mirror repo (level 2 in the diagram), messes up all the upstream refs, even though they still exist in packed-refs. Any new clones clone to the dev machine (level 3) only see the new branches, and not any of the other in the main mirror.

Show 8 quoted lines
> This will make the upstream's heads and tags as they were pushed
> to the hub repo directly, but with the "origin/" prefix.
>
>> $ git clone http://local-server/local-mirror.git
>> Initialized empty Git repository in /home/clemej/git/local-mirror/.git/
>> warning: remote HEAD refers to nonexistent ref, unable to checkout.
>
> What does the refs/HEAD file tell in the local mirror repo ?

On the local mirror, HEAD is: ref: refs/heads/xxx/stable

On any new clone, HEAD still points to refs/heads/master (presumably because the checkout failed).

Thanks, john.c

-- 
John Clemens <clemej@gmail.com>
Previous: Enrico WeigeltNext: Enrico Weigelt
Message 3 of 5 in “mirroring and development with three levels of repositories?”
  1. John ClemensSep 28, 2010
  2. Enrico WeigeltSep 28, 2010
  3. John ClemensSep 28, 2010
  4. Enrico WeigeltSep 28, 2010
  5. John ClemensSep 29, 2010

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.