Jeff King <peff@xxxxxxxx> writes: > 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 ;-).