git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
NCNicolas Cuillery <nicolas.cuillery@gmail.com>
Date
Sep 19, 2016, 14:26 UTC
Message-ID
<CACmQg1hE=ytaatDfUJLkhL0p5c43wZZvgt+8pc5zoo0YFdQw6A@mail.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:
Show 11 quoted lines
>$ 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

Next: Junio C Hamano
Message 1 of 2 in “[Bug] Custom git-dir directory shouldn't be listed as “untracked””
  1. Nicolas CuillerySep 19, 2016
  2. Junio C HamanoSep 19, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.