# bare repositories: packing and fetching

4 messages from 2006-09-15 to 2006-09-15. Participants: Andy Whitcroft, Jakub Narebski, Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/5575

## Andy Whitcroft, 2006-09-15 18:04

Subject: bare repositories: packing and fetching
Message-ID: <450AEB37.3090909@shadowen.org>
URL: https://gitlist.dev/e/450AEB37.3090909%40shadowen.org

```
I was trying to make a bare repo to stage linus' main tree.  As this was
only to be a local tree for others to pull from I thought that I could
clone his tree 'bare' and then fetch into that on a regular basis.  That
does not appear to be the case?  Both git fetch and git repack say 'not
a git repository .git' and bail.

Is this expected behaviour.  Do I have to have all the checked out files?

-apw

```

## Jakub Narebski, 2006-09-15 18:11

Subject: Re: bare repositories: packing and fetching
Message-ID: <eeeqbv$8na$1@sea.gmane.org>
URL: https://gitlist.dev/e/eeeqbv%248na%241%40sea.gmane.org
In-Reply-To: <450AEB37.3090909@shadowen.org>

```
Andy Whitcroft wrote:

> I was trying to make a bare repo to stage linus' main tree.  As this was
> only to be a local tree for others to pull from I thought that I could
> clone his tree 'bare' and then fetch into that on a regular basis.  That
> does not appear to be the case?  Both git fetch and git repack say 'not
> a git repository .git' and bail.
> 
> Is this expected behaviour.  Do I have to have all the checked out files?

No, but perhaps git doesn't detect _where_ is a git repository. With full
repository git tries to find .git somewhere in the directory, or it's
parents, if I understand correctly.

If running git commands from the inside of bare repository doesn't work, try
setting enviromental variable GIT_DIR (e.g. GIT_DIR=git.git git fetch
origin), or with git 1.4.2 or newer with --git-dir option (e.g. git
--git-dir=git fetch origin).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Johannes Schindelin, 2006-09-15 18:50

Subject: Re: bare repositories: packing and fetching
Message-ID: <Pine.LNX.4.63.0609152049310.19042@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0609152049310.19042%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <eeeqbv$8na$1@sea.gmane.org>

```
Hi,

On Fri, 15 Sep 2006, Jakub Narebski wrote:

> Andy Whitcroft wrote:
> 
> > I was trying to make a bare repo to stage linus' main tree.  As this was
> > only to be a local tree for others to pull from I thought that I could
> > clone his tree 'bare' and then fetch into that on a regular basis.  That
> > does not appear to be the case?  Both git fetch and git repack say 'not
> > a git repository .git' and bail.
> > 
> > Is this expected behaviour.  Do I have to have all the checked out files?
> 
> No, but perhaps git doesn't detect _where_ is a git repository. With full
> repository git tries to find .git somewhere in the directory, or it's
> parents, if I understand correctly.

Exactly. Since there is no .git directory, git does not know where it 
should look for the repository.

Try "git --bare fetch".

Hth,
Dscho

```

## Junio C Hamano, 2006-09-15 20:44

Subject: Re: bare repositories: packing and fetching
Message-ID: <7vzmd0g8rk.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vzmd0g8rk.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <450AEB37.3090909@shadowen.org>

```
Andy Whitcroft <apw@shadowen.org> writes:

> I was trying to make a bare repo to stage linus' main tree.  As this was
> only to be a local tree for others to pull from I thought that I could
> clone his tree 'bare' and then fetch into that on a regular basis.  That
> does not appear to be the case?  Both git fetch and git repack say 'not
> a git repository .git' and bail.
>
> Is this expected behaviour.  Do I have to have all the checked out files?

cd $that_repository && GIT_DIR=. git fetch

```
