# .git as file pointing to directory?

7 messages from 2010-11-04 to 2010-11-04. Participants: Brad Larson, Matthieu Moy, Jonathan Nieder, Jens Lehmann.
Thread: https://gitlist.dev/t/25644

## Brad Larson, 2010-11-04 18:22

Subject: .git as file pointing to directory?
Message-ID: <AANLkTikB4p9=EQRsAJTe4-nAw5udz2pfcRd4WPsfms86@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikB4p9%3DEQRsAJTe4-nAw5udz2pfcRd4WPsfms86%40mail.gmail.com

```
Sorry if this is obvious, I can't figure out what term to search for.

At gittogether there was some talk about having .git be a file, not a
folder, with contents pointing to the real .git directory.  Similar to
a symlink, but supported in Windows.  Is there a specific name for
this feature?  Where can I find more details?  Which version of git
introduced this?

Thanks!
Brad

```

## Matthieu Moy, 2010-11-04 18:32

Subject: Re: .git as file pointing to directory?
Message-ID: <vpqpqulc52q.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqpqulc52q.fsf%40bauges.imag.fr
In-Reply-To: <AANLkTikB4p9=EQRsAJTe4-nAw5udz2pfcRd4WPsfms86@mail.gmail.com>

```
Brad Larson <bklarson@gmail.com> writes:

> Sorry if this is obvious, I can't figure out what term to search for.
>
> At gittogether there was some talk about having .git be a file, not a
> folder, with contents pointing to the real .git directory.  Similar to
> a symlink, but supported in Windows.  Is there a specific name for
> this feature?  Where can I find more details?  Which version of git
> introduced this?

It has been discussed under the name "gitlink", which was
unfortunately also used for something else in the subtree
implementation, but AFAIK, it has never been implemented.

The closest equivalent is git-new-workdir, but it relies on symlinks,
and shares a bit more than it should with the other repository (i.e.
if you checkout the same branch is two workdirs, you're doomed).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Jonathan Nieder, 2010-11-04 18:43

Subject: Re: .git as file pointing to directory?
Message-ID: <20101104184321.GA16929@burratino>
URL: https://gitlist.dev/e/20101104184321.GA16929%40burratino
In-Reply-To: <AANLkTikB4p9=EQRsAJTe4-nAw5udz2pfcRd4WPsfms86@mail.gmail.com>

```
Hi Brad,

Brad Larson wrote:

> At gittogether there was some talk about having .git be a file, not a
> folder, with contents pointing to the real .git directory.  Similar to
> a symlink, but supported in Windows.

It is called a .git file.  See gitrepository-layout(5), v1.5.6-rc0~93^2~3
(Add platform-independent .git "symlink", 2008-02-20), and the recent
rebase not handling core.worktree thread[1].

Hope that helps,
Jonathan

[1] http://thread.gmane.org/gmane.comp.version-control.git/160488/focus=160567

```

## Jens Lehmann, 2010-11-04 20:35

Subject: Re: .git as file pointing to directory?
Message-ID: <4CD31904.5040308@web.de>
URL: https://gitlist.dev/e/4CD31904.5040308%40web.de
In-Reply-To: <vpqpqulc52q.fsf@bauges.imag.fr>

```
Am 04.11.2010 19:32, schrieb Matthieu Moy:
> Brad Larson <bklarson@gmail.com> writes:
> 
>> Sorry if this is obvious, I can't figure out what term to search for.
>>
>> At gittogether there was some talk about having .git be a file, not a
>> folder, with contents pointing to the real .git directory.  Similar to
>> a symlink, but supported in Windows.  Is there a specific name for
>> this feature?  Where can I find more details?  Which version of git
>> introduced this?
> 
> It has been discussed under the name "gitlink", which was
> unfortunately also used for something else in the subtree
> implementation, but AFAIK, it has never been implemented.

Hmm, AFAIK gitlinks are already in heavy use for submodule entries ...

```

## Brad Larson, 2010-11-04 21:07

Subject: Re: .git as file pointing to directory?
Message-ID: <AANLkTinMiSNCC0EUDRvxiW0V+upjEemP_xYwjcWcNC6L@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinMiSNCC0EUDRvxiW0V%2BupjEemP_xYwjcWcNC6L%40mail.gmail.com
In-Reply-To: <20101104184321.GA16929@burratino>

```
On Thu, Nov 4, 2010 at 1:43 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Hi Brad,
>
> Brad Larson wrote:
>
>> At gittogether there was some talk about having .git be a file, not a
>> folder, with contents pointing to the real .git directory.  Similar to
>> a symlink, but supported in Windows.
>
> It is called a .git file.  See gitrepository-layout(5), v1.5.6-rc0~93^2~3
> (Add platform-independent .git "symlink", 2008-02-20), and the recent
> rebase not handling core.worktree thread[1].

Thanks so much Jonathan.  We were just listing the location of the
folder, but prepending it with "gitdir: " fixed things.

Thanks!
Brad

>
> Hope that helps,
> Jonathan
>
> [1] http://thread.gmane.org/gmane.comp.version-control.git/160488/focus=160567
>

```

## Matthieu Moy, 2010-11-04 22:14

Subject: Re: .git as file pointing to directory?
Message-ID: <vpqbp64d9e0.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqbp64d9e0.fsf%40bauges.imag.fr
In-Reply-To: <4CD31904.5040308@web.de>

```
Jens Lehmann <Jens.Lehmann@web.de> writes:

> Am 04.11.2010 19:32, schrieb Matthieu Moy:
>> Brad Larson <bklarson@gmail.com> writes:
>> 
>>> Sorry if this is obvious, I can't figure out what term to search for.
>>>
>>> At gittogether there was some talk about having .git be a file, not a
>>> folder, with contents pointing to the real .git directory.  Similar to
>>> a symlink, but supported in Windows.  Is there a specific name for
>>> this feature?  Where can I find more details?  Which version of git
>>> introduced this?
>> 
>> It has been discussed under the name "gitlink", which was
>> unfortunately also used for something else in the subtree
>> implementation, but AFAIK, it has never been implemented.
>
> Hmm, AFAIK gitlinks are already in heavy use for submodule entries ...

Err, isn't that precisely what I was saying? The same word has been
used in the subtree implementation, but the other concept with the
same name hasn't been implemented.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Jens Lehmann, 2010-11-04 23:28

Subject: Re: .git as file pointing to directory?
Message-ID: <4CD34194.8010002@web.de>
URL: https://gitlist.dev/e/4CD34194.8010002%40web.de
In-Reply-To: <vpqbp64d9e0.fsf@bauges.imag.fr>

```
Am 04.11.2010 23:14, schrieb Matthieu Moy:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
> 
>> Am 04.11.2010 19:32, schrieb Matthieu Moy:
>>> Brad Larson <bklarson@gmail.com> writes:
>>>
>>>> Sorry if this is obvious, I can't figure out what term to search for.
>>>>
>>>> At gittogether there was some talk about having .git be a file, not a
>>>> folder, with contents pointing to the real .git directory.  Similar to
>>>> a symlink, but supported in Windows.  Is there a specific name for
>>>> this feature?  Where can I find more details?  Which version of git
>>>> introduced this?
>>>
>>> It has been discussed under the name "gitlink", which was
>>> unfortunately also used for something else in the subtree
>>> implementation, but AFAIK, it has never been implemented.
>>
>> Hmm, AFAIK gitlinks are already in heavy use for submodule entries ...
> 
> Err, isn't that precisely what I was saying? The same word has been
> used in the subtree implementation, but the other concept with the
> same name hasn't been implemented.

Sorry, seems like I misunderstood what you where saying.

```
