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

Re: GIT_DIR in aliases [Re: Spurious GIT_DIR set when in a worktree [was Re: Nested submodule status bug]

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 28, 2020, 20:22 UTC
Message-ID
<xmqq4kvaea2l.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200228190218.GC1408759@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> Yes, the recommended thing is to make sure GIT_DIR is unset if you're
> going to chdir around and expect auto-discovery of the repository to
> work.
>
> Note there are other variables you might want to unset, too, if you're
> switching repositories. Doing:
>
>   unset $(git rev-parse --local-env-vars)
>
> would cover the full list.

Thanks for mentioning --local-env-vars; I was going to ask you to mention GIT_WORK_TREE anytime you mention unsetting GIT_DIR, but you did it much better ;-).

Previous: Jeff KingNext: Damien Robert
Message 10 of 13 in “Nested submodule checkout”
  1. Damien RobertFeb 14, 2020
  2. Philippe BlainFeb 17, 2020
  3. Damien RobertFeb 18, 2020
  4. Philippe BlainFeb 19, 2020
  5. Nested submodule status bugDamien Robert, Feb 26, 2020
  6. Damien RobertFeb 27, 2020
  7. Spurious GIT_DIR set when in a worktree [was Re: Nested submodule status bug]Damien Robert, Feb 27, 2020
  8. GIT_DIR in aliases [Re: Spurious GIT_DIR set when in a worktree [was Re: Nested submodule status bug]Damien Robert, Feb 27, 2020
  9. Jeff KingFeb 28, 2020
  10. Junio C HamanoFeb 28, 2020
  11. Damien RobertMar 3, 2020
  12. Philippe BlainFeb 29, 2020
  13. Damien RobertMar 3, 2020

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.