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 ;-).