# git-relink doesn't work on bare repos

5 messages from 2008-03-04 to 2008-03-04. Participants: John Goerzen, Sean, Johannes Schindelin.
Thread: https://gitlist.dev/t/12470

## John Goerzen, 2008-03-04 00:29

Subject: git-relink doesn't work on bare repos
Message-ID: <slrnfsp5vi.sa5.jgoerzen@katherina.lan.complete.org>
URL: https://gitlist.dev/e/slrnfsp5vi.sa5.jgoerzen%40katherina.lan.complete.org

```
If I try to point git-relink at a bare repo, I get:

Usage: /usr/bin/git-relink [--safe] <dir> [<dir> ...] <master_dir>
All directories should contain a .git/objects/ subdirectory.

In my case, both master_dir and the CWD are bare repos.

This is 1.5.4.2



```

## Sean, 2008-03-04 07:09

Subject: Re: git-relink doesn't work on bare repos
Message-ID: <BAYC1-PASMTP07875E628BE4BA7D43175FAE100@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP07875E628BE4BA7D43175FAE100%40CEZ.ICE
In-Reply-To: <slrnfsp5vi.sa5.jgoerzen@katherina.lan.complete.org>

```
On Mon, 3 Mar 2008 18:29:38 -0600
John Goerzen <jgoerzen@complete.org> wrote:

> If I try to point git-relink at a bare repo, I get:
> 
> Usage: /usr/bin/git-relink [--safe] <dir> [<dir> ...] <master_dir>
> All directories should contain a .git/objects/ subdirectory.
> 
> In my case, both master_dir and the CWD are bare repos.
> 
> This is 1.5.4.2

Hi John,

It should probably fixed to work as you would expect.   But if your bare repos
follow the general naming convention of ending in .git  relink will work.  That is,
if your bare repos are named  repo.git  rather than just repo.

HTH,
Sean

```

## John Goerzen, 2008-03-04 14:34

Subject: Re: git-relink doesn't work on bare repos
Message-ID: <200803040834.14099.jgoerzen@complete.org>
URL: https://gitlist.dev/e/200803040834.14099.jgoerzen%40complete.org
In-Reply-To: <BAYC1-PASMTP07875E628BE4BA7D43175FAE100@CEZ.ICE>

```
On Tue March 4 2008 1:09:59 am Sean wrote:

> It should probably fixed to work as you would expect.   But if your bare

Yep, agreed there.

> repos follow the general naming convention of ending in .git  relink will
> work.  That is, if your bare repos are named  repo.git  rather than just
> repo.

I never do that because I think it's silly to have to type .git everytime ;-)

If I give people a git:// url, they already know it's a Git repo, I figure.

-- John

```

## Johannes Schindelin, 2008-03-04 15:03

Subject: Re: git-relink doesn't work on bare repos
Message-ID: <alpine.LSU.1.00.0803041501500.22527@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803041501500.22527%40racer.site
In-Reply-To: <200803040834.14099.jgoerzen@complete.org>

```
Hi,

On Tue, 4 Mar 2008, John Goerzen wrote:

> On Tue March 4 2008 1:09:59 am Sean wrote:
> 
> > repos follow the general naming convention of ending in .git relink 
> > will work.  That is, if your bare repos are named repo.git rather than 
> > just repo.
> 
> I never do that because I think it's silly to have to type .git 
> everytime ;-)

Well, it is a convention, and if you choose not to follow it, that's what 
you get.

> If I give people a git:// url, they already know it's a Git repo, I 
> figure.

So you must use "--git-dir" _everytime_ you are working with Git inside 
the repo.

It's not like relink has to be performed several times per hour.

Ciao,
Dscho


```

## John Goerzen, 2008-03-04 15:19

Subject: Re: git-relink doesn't work on bare repos
Message-ID: <200803040919.19641.jgoerzen@complete.org>
URL: https://gitlist.dev/e/200803040919.19641.jgoerzen%40complete.org
In-Reply-To: <alpine.LSU.1.00.0803041501500.22527@racer.site>

```
On Tue March 4 2008 9:03:15 am Johannes Schindelin wrote:
> Hi,
>
> On Tue, 4 Mar 2008, John Goerzen wrote:
> > On Tue March 4 2008 1:09:59 am Sean wrote:
> > > repos follow the general naming convention of ending in .git relink
> > > will work.  That is, if your bare repos are named repo.git rather than
> > > just repo.
> >
> > I never do that because I think it's silly to have to type .git
> > everytime ;-)
>
> Well, it is a convention, and if you choose not to follow it, that's what
> you get.

That's not documented anywhere.

I mean, git is plubming, right?  I should be able to call it myrepo.exe if I 
like, and as long as it has a .git dir with stuff in it, or is bare, it 
should just work.

> > If I give people a git:// url, they already know it's a Git repo, I
> > figure.
>
> So you must use "--git-dir" _everytime_ you are working with Git inside
> the repo.

That's not been my experience.  In fact, I can 'git log' quite happily inside 
a bare repo.  Why on earth should git-relink care what I have named my repo?  
It's not like git clone, push, pull, or anything else cares.

-- John

```
