threads / discuss / 5575

bare repositories: packing and fetching

Subject: bare repositories: packing and fetching

## tl;dr

4 messages between Sep 15, 2006 and Sep 15, 2006.

replies: 3people: 4as markdown or json

Andy Whitcroft· Sep 15, 2006, 18:04 UTC · lore

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· Sep 15, 2006, 18:11 UTC · re: Andy Whitcroft · lore

Re: bare repositories: packing and fetching

Andy Whitcroft wrote:
Show 7 quoted lines
> 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· Sep 15, 2006, 18:50 UTC · re: Jakub Narebski · lore

Re: bare repositories: packing and fetching

Hi,
On Fri, 15 Sep 2006, Jakub Narebski wrote:
Show 13 quoted lines
> 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· Sep 15, 2006, 20:44 UTC · re: Andy Whitcroft · lore

Re: bare repositories: packing and fetching

Andy Whitcroft <apw@shadowen.org> writes:
Show 7 quoted lines
> 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

← back to recent threads