# [Bug] Custom git-dir directory shouldn't be listed as “untracked”

2 messages from 2016-09-19 to 2016-09-19. Participants: Nicolas Cuillery, Junio C Hamano.
Thread: https://gitlist.dev/t/44111

## Nicolas Cuillery, 2016-09-19 14:26

Subject: [Bug] Custom git-dir directory shouldn't be listed as “untracked”
Message-ID: <CACmQg1hE=ytaatDfUJLkhL0p5c43wZZvgt+8pc5zoo0YFdQw6A@mail.gmail.com>
URL: https://gitlist.dev/e/CACmQg1hE%3DytaatDfUJLkhL0p5c43wZZvgt%2B8pc5zoo0YFdQw6A%40mail.gmail.com

```
Hi, I want to create a local repository with a custom dir name instead
of ".git", I used the env vars GIT_DIR and WORK_TREE:
>export GIT_DIR=".customgitdir"
>export GIT_WORK_TREE="."

Then I created a repo in an empty directory:
>$ git init
>Initialized empty Git repository in XXXXXXXXX/.customgitdir/

Then I ran git status:
>$ git status
>On branch master
>
>Initial commit
>
>Untracked files:
>  (use "git add <file>..." to include in what will be committed)
>
>    .customgitdir/
>
>nothing added to commit but untracked files present (use "git add" to track)

The local repo directory listed as "untracked files" which is a
problem when using "git add ." afterwards.

When using the default directory ".git", it logically doesn't appear
in the "git status" command's output. Don't you think it should be the
same when using a custom dir name ?

Git version 2.6.4 on MacOSX 10.11

Regards,
Nicolas

```

## Junio C Hamano, 2016-09-19 17:45

Subject: Re: [Bug] Custom git-dir directory shouldn't be listed as “untracked”
Message-ID: <xmqqeg4fg4w6.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqeg4fg4w6.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CACmQg1hE=ytaatDfUJLkhL0p5c43wZZvgt+8pc5zoo0YFdQw6A@mail.gmail.com>

```
Nicolas Cuillery <nicolas.cuillery@gmail.com> writes:

> When using the default directory ".git", it logically doesn't appear
> in the "git status" command's output. Don't you think it should be the
> same when using a custom dir name ?

Not really.

GIT_DIR=<there> mechanism was never meant to be used to name a
directory that sitsinside your working tree (an exception is if it
is actually ".git" at the top).

```
