{"version":"2.1.222","anchor":"worktree-git-commands-run-with-a-scrubbed-git-environment","canonical_anchor":"worktree-git-commands-run-with-a-scrubbed-git-environment","heading":"Worktree git commands run with a scrubbed git environment","tier":"notice","area":"Worktrees","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.222\/e\/worktree-git-commands-run-with-a-scrubbed-git-environment","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.222","markdown":"### Worktree git commands run with a scrubbed git environment\n\nStray git environment variables in your shell can no longer misdirect worktree operations.\n\n**What**\n\nWorktree plumbing no longer inherits ambient git environment variables, so a stray GIT_DIR or a repo fsmonitor cannot redirect worktree operations.\n\n**Details**\n\n- covers create, remove, lock, status, reset, rev-parse and sparse-checkout\n- blanks GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE, GIT_CONFIG_COUNT, GIT_CONFIG_PARAMETERS, the per-index GIT_CONFIG_KEY_n and GIT_CONFIG_VALUE_n pairs, and more\n- all calls go through the shared `-c core.hooksPath=\/dev\/null -c core.fsmonitor=` prefix\n\n**Evidence**\n\n`GIT_ALTERNATE_OBJECT_DIRECTORIES: void 0`\n\n- Area: Worktrees\n- Names: `GIT_DIR`, `GIT_WORK_TREE`, `GIT_INDEX_FILE`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 0\/5"}