RE: What's the ".git/gitdir" file?
- From
Randall S. Becker <rsbecker@nexbridge.com>
- Date
- Oct 27, 2015, 22:42 UTC
- Message-ID
- <017901d11108$ceb2cd10$6c186730$@com>
- In-Reply-To
- <CAGZ79ka0XvmvVpX5WrpeEBXBWKA41RTZm4p7q=QtUTFy18hkoA@mail.gmail.com>
-----Original Message----- On Tue, October-27-15 6:23 PM, Stefan Beller wrote:
Show 26 quoted lines
>On Tue, Oct 27, 2015 at 3:04 PM, Kyle Meyer <kyle@kyleam.com> wrote: >> When a ".git" file points to another repo, a ".git/gitdir" file is >> created in that repo. >> >> For example, running >> >> $ mkdir repo-a repo-b >> $ cd repo-a >> $ git init >> $ cd ../repo-b >> $ echo "gitdir: ../repo-a/.git" > .git >> $ git status >> >> results in a file "repo-a/.git/gitdir" that contains >> >> $ cat repo-a/.git/gitdir >> .git >> >> I don't see this file mentioned in the gitrepository-layout manpage, >> and my searches haven't turned up any information on it. What's the >> purpose of ".git/gitdir"? Are there cases where it will contain >> something other than ".git"? > >It's designed for submodules to work IIUC. > >Back in the day each git submodule had its own .git directory keeping its local >objects.
>Nowadays the repository of submodule <name> is kept in the superprojects >.git/modules/<name> directory.
Slightly OT: Is there any way of avoiding having that file in the first place? I'm hoping to have a git repository in a normal file system (Posix) and a working area in a rather less-than-normal one where dots in file names are bad (actually a dot is a separator).
Cheers, Randall