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

Re: how to use two bare repositories?

From
JHJean-Luc Herren <jlh@gmx.ch>
Date
Apr 11, 2008, 23:19 UTC
Message-ID
<47FFF219.1080707@gmx.ch>
In-Reply-To
<20080411222205.GN29940@cs-wsok.swansea.ac.uk>
Oliver Kullmann wrote:
Show 19 quoted lines
> I have the following problem:
> 
> We use a public repository, a bare repository A,
> used with push and pull via ssh.
> A is only to be used by the core developer group.
> 
> Now I want to create another public repository B,
> from which anonymous pull is possible via http.
> So B should be another bare repository.
> 
> The problem is now that it seems not to be possible
> to update B:
> 
> 1. pulling from A is not possible since B is bare;
> 2. fetching from A seems to work, checking the content of
>    B via gitk seems to indicate that B has been updated
>  --- however pulling from B doesn't work: The newly
>  fetched changes are not transported to a repository
>  which pulls from B ???

Probably in your setup, B is tracking A as a remote and if you fetch, only those remotes are updated, but not the local branches in B. If you then clone from B, you don't get B's remotes, you get B's branches. You probably want to do this:

path/to/B$ git remote rm origin path/to/B$ git remote add --mirror origin path/to/A

Though, I wonder if it makes sense to have a 'git clone --bare' set up the remote in mirror mode by default. I'm unsure of what use remotes are in a bare repo.

jlh
Previous: Junio C HamanoNext: Oliver Kullmann
Message 3 of 4 in “how to use two bare repositories?”
  1. Oliver KullmannApr 11, 2008
  2. Junio C HamanoApr 11, 2008
  3. Jean-Luc HerrenApr 11, 2008
  4. Oliver KullmannApr 11, 2008

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.