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

Re: git status doesn't ignore GIT_DIR directory?

From
Junio C Hamano <gitster@pobox.com>
Date
May 23, 2015, 02:03 UTC
Message-ID
<CAPc5daW2yTHHegPDrEWS5KiSYWZECV+AxMnewzz9ayASB1QNUw@mail.gmail.com>
In-Reply-To
<555FD1EA.2060706@rightscale.com>

As far as I know, GIT_DIR was prepared as a mechanism to point at another .git directory that does not live inside the working tree, not as a mechanism to rename it to arbitrary name. E.g.

 $ git init
 $ mv .git .svn
 $ GIT_DIR=$(pwd)/.svn ; export GIT_DIR
is not expected to work.
On Fri, May 22, 2015 at 6:03 PM, Thorsten von Eicken <tve@rightscale.com> wrote:
Show 21 quoted lines
> I renamed my .git directory to _git and I'm surprised that git status thinks
> that it's an untracked file:
>
> $ GIT_DIR=_git git status
> On branch master
> Your branch is up-to-date with 'origin/master'.
>
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
>
>         _git/
>
> nothing added to commit but untracked files present (use "git add" to track)
>
> This doesn't seem to make sense, shouldn't git ignore whatever $GIT_DIR
> points to? Or is there some other magic option I need to use for it to do
> what I expect?
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Thorsten von EickenNext: Duy Nguyen
Message 2 of 10 in “git status doesn't ignore GIT_DIR directory?”
  1. Thorsten von EickenMay 23, 2015
  2. Junio C HamanoMay 23, 2015
  3. Duy NguyenMay 23, 2015
  4. Thorsten von EickenMay 23, 2015
  5. Duy NguyenMay 23, 2015
  6. Mike HommeyMay 23, 2015
  7. Duy NguyenMay 23, 2015
  8. Junio C HamanoMay 23, 2015
  9. Junio C HamanoMay 23, 2015
  10. Junio C HamanoMay 23, 2015

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.