# how to use two bare repositories?

4 messages from 2008-04-11 to 2008-04-11. Participants: Oliver Kullmann, Junio C Hamano, Jean-Luc Herren.
Thread: https://gitlist.dev/t/13067

## Oliver Kullmann, 2008-04-11 22:22

Subject: how to use two bare repositories?
Message-ID: <20080411222205.GN29940@cs-wsok.swansea.ac.uk>
URL: https://gitlist.dev/e/20080411222205.GN29940%40cs-wsok.swansea.ac.uk

```
Hi,

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 ???

Hope somebody can shed light on this behaviour.

Thanks!

Oliver

```

## Junio C Hamano, 2008-04-11 23:17

Subject: Re: how to use two bare repositories?
Message-ID: <7v7if4ouan.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7if4ouan.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080411222205.GN29940@cs-wsok.swansea.ac.uk>

```
Oliver Kullmann <O.Kullmann@swansea.ac.uk> writes:

> 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 usual answer when you see a word "http" mentioned is...

	how are you arranging update-server-info to be run whenever B is
	updated?

```

## Jean-Luc Herren, 2008-04-11 23:19

Subject: Re: how to use two bare repositories?
Message-ID: <47FFF219.1080707@gmx.ch>
URL: https://gitlist.dev/e/47FFF219.1080707%40gmx.ch
In-Reply-To: <20080411222205.GN29940@cs-wsok.swansea.ac.uk>

```
Oliver Kullmann wrote:
> 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

```

## Oliver Kullmann, 2008-04-11 23:23

Subject: Re: how to use two bare repositories?
Message-ID: <20080411232337.GO29940@cs-wsok.swansea.ac.uk>
URL: https://gitlist.dev/e/20080411232337.GO29940%40cs-wsok.swansea.ac.uk
In-Reply-To: <20080411222205.GN29940@cs-wsok.swansea.ac.uk>

```
Just adding a further question:

Apparently bare repositories are strange things,
which perhaps are not really supported by git.
Alright, then I use additionally a real repository C.

Now in the automated process of package generation,
the user of my library gets always a clone of C,
created by

git clone --no-hardlinks path-to-C

However having the origin C built into that clone
is not really useful, since no user has access to C.
The natural think to do would be to use instead

git clone --no-hardlinks --origin http:address-of-B path-to-C

but unfortunately 

git complains that "http:address-of-B" is not suitable
as an origin??

However "http:address-of-B" works for pull ?

If option "origin" doesn't work, how else is it possible
to provide the package-clone with a sensible default value
for the pull-operation (this can only be B here)?

Oliver


On Fri, Apr 11, 2008 at 11:22:05PM +0100, Oliver Kullmann wrote:
> Hi,
> 
> 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 ???
> 
> Hope somebody can shed light on this behaviour.
> 
> Thanks!
> 
> Oliver
> 
> --

```
