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

Re: Need to set GIT_WORK_TREE when setting GIT_DIR !?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 10, 2012, 21:20 UTC
Message-ID
<7vsjhg17bh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8AUo3+ECdxfnyfYGA-mAtHB8KBOUrie3_Qo3cyfshZmAA@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> Historical reason: before separate worktree feature was introduced,
> git assumed worktree was at $GIT_DIR's parent directory.

Isn't the rule that the current directory becomes the root of the working tree if you did not have GIT_WORK_TREE?

In any case, the way I read Frédéric is that the other repository's files will be accessed only from the root of the working tree, so as long as the GIT_DIR/config says it is not a bare repository, it should be OK.

Previous: Nguyen Thai Ngoc DuyNext: Jonathan Nieder
Message 5 of 7 in “Need to set GIT_WORK_TREE when setting GIT_DIR !?”
  1. Frédéric HeitzmannMar 9, 2012
  2. Junio C HamanoMar 9, 2012
  3. Frédéric HeitzmannMar 10, 2012
  4. Nguyen Thai Ngoc DuyMar 10, 2012
  5. Junio C HamanoMar 10, 2012
  6. Jonathan NiederMar 10, 2012
  7. Frédéric HeitzmannMar 11, 2012

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.