threads / discuss / 25644

.git as file pointing to directory?

Subject: .git as file pointing to directory?

## tl;dr

7 messages between Nov 4, 2010 and Nov 4, 2010.

replies: 6people: 4as markdown or json

Brad Larson· Nov 4, 2010, 18:22 UTC · lore
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· Nov 4, 2010, 18:32 UTC · re: Brad Larson · lore

Re: .git as file pointing to directory?

Brad Larson <bklarson@gmail.com> writes:
Show 7 quoted lines
> 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/
Jens Lehmann· Nov 4, 2010, 20:35 UTC · re: Matthieu Moy · lore

Re: .git as file pointing to directory?

Am 04.11.2010 19:32, schrieb Matthieu Moy:
Show 13 quoted lines
> 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 ...
Matthieu Moy· Nov 4, 2010, 22:14 UTC · re: Jens Lehmann · lore

Re: .git as file pointing to directory?

Jens Lehmann <Jens.Lehmann@web.de> writes:
Show 16 quoted lines
> 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· Nov 4, 2010, 23:28 UTC · re: Matthieu Moy · lore

Re: .git as file pointing to directory?

Am 04.11.2010 23:14, schrieb Matthieu Moy:
Show 22 quoted lines
> 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.
Jonathan Nieder· Nov 4, 2010, 18:43 UTC · re: Brad Larson · lore

Re: .git as file pointing to directory?

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
Brad Larson· Nov 4, 2010, 21:07 UTC · re: Jonathan Nieder · lore

Re: .git as file pointing to directory?

On Thu, Nov 4, 2010 at 1:43 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 11 quoted lines
> 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

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

← back to recent threads