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

Re: confusing GIT_DIR behavior case

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 17, 2008, 23:00 UTC
Message-ID
<7v8x0harbt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1205793829.5984.1242927563@webmail.messagingengine.com>
"Britton Kerin" <bkerin@fastmail.fm> writes:
Show 7 quoted lines
>    1.  GIT_DIR (and --git-dir) should make git behave exactly as if git
>    was 
>        wired to look for $GIT_DIR rather than '.git'.  The occurence of
>        the
>        GIT_DIR description in the top-level man page (for 'man git')
>        seems to
>        suggest that this is how things work.

That's underdescribing things. Presense of GIT_DIR means much more than that (e.g. you are at the top-level of the repository unless you have WORK_TREE).

>    4.  The noob docs should make some mention of this issue.

Which "noob docs" did you look at (and do you think other people would most likely to look at)? I think the most important description they need is not to mess with these environment variables. It might sometimes be needed to move .git away from its default place (and I haven't been in that situation yet, so you have to be more advanced than me ;-)), but if you are doing such a non-default thing, you are certainly no longer "noob".

Previous: Britton Kerin
Message 2 of 2 in “confusing GIT_DIR behavior case”
  1. Britton KerinMar 17, 2008
  2. Junio C HamanoMar 17, 2008

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.