{"name":"GIT_CONFIG","slug":"git-config","family":"env","title":"Environment variables","noun":"environment variable","description":"Claude inspects a synced checkout's git config first and refuses to run git there if it looks unsafe.","description_source":"entry","described_by":{"version":"2.1.242","anchor":"claude-checks-a-checkout-s-git-configuration-before-running-"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.309","builds":0,"mined_builds":150,"first_cited":{"version":"2.1.290","released_at":"2026-10-05 18:12:44","spans":2}},"aliases":[],"entries":[{"version":"2.1.305","anchor":"git-env-git-config-only-cleared-conditionally-headless-liv","heading":"GIT_CONFIG is now cleared only in some cases in one git runner","line":"One git runner now clears `GIT_CONFIG` only under certain conditions instead of always, and session setup gains new options","released_at":"2026-10-20 19:29:36","reason":"found in this entry's text"},{"version":"2.1.296","anchor":"custom-headers-check-function-replaced-and-git-subprocess-e","heading":"Git commands run by Claude Code no longer inherit GIT_CONFIG","line":"Claude Code clears any `GIT_CONFIG` variable before running git, and now compares `ANTHROPIC_CUSTOM_HEADERS` with a value from another source","released_at":"2026-10-09 16:58:10","reason":"found in this entry's text"},{"version":"2.1.290","anchor":"bash-command-safety-reasons-shortened","heading":"Shorter reasons when a shell command needs your approval","line":"The reasons Claude Code gives for asking you to approve a shell command are shorter, with some explanations in brackets removed","released_at":"2026-10-05 18:12:44","reason":"found in this entry's text"},{"version":"2.1.290","anchor":"git-env-vars-sanitized-more-broadly","heading":"Claude Code removes more git environment variables before running git","line":"Before running git, Claude Code now clears a wider fixed set of git environment variables, not just GIT_CONFIG and GIT_ATTR_SOURCE","released_at":"2026-10-05 18:12:44","reason":"found in this entry's text"},{"version":"2.1.282","anchor":"cloud-session-git-upload-refuses-when-git-attribute-settings","heading":"Cloud session uploads refuse when git attribute settings can't be followed","line":"Uploading your files to a cloud session now stops with steps to fix it when git attribute settings live somewhere the upload can't read","released_at":"2026-09-24 15:56:22","reason":"found in this entry's text"},{"version":"2.1.274","anchor":"git-env-allowlist-changed-config-override-vars-removed-nam","heading":"Git env allowlist changed: config-override vars removed, namespace\/worktree vars added","line":"The GIT_* environment variables Claude Code sanitizes before running git changed: config-override vars dropped, namespace\/worktree vars added","released_at":"2026-09-16 22:36:09","reason":"found in this entry's text"},{"version":"2.1.271","anchor":"bash-tool-git-command-parsing-hardened-for-pathpermission-e","heading":"Bash-tool git command parsing hardened for path\/permission extraction","line":"Bash-tool permission logic parses git commands more carefully before approving them","released_at":"2026-09-14 19:45:19","reason":"found in this entry's text"},{"version":"2.1.248","anchor":"directory-sync-only-runs-the-git-it-found-when-the-process-s","heading":"Directory sync only runs the git it found when the process started","line":"Directory sync pins git to the PATH from startup, so later PATH changes can't swap it.","released_at":"2026-08-27 20:35:36","reason":"found in this entry's text"},{"version":"2.1.247","anchor":"repo-git-hooks-are-opt-in-tag-pushes-opt-in-and-git-config-i","heading":"Repo git hooks are opt-in, tag pushes opt in, and GIT_CONFIG is blocked","line":"Repo git hooks stay suppressed by default, tag pushes excepted, and GIT_CONFIG is now cleared.","released_at":"2026-08-26 18:02:01","reason":"named in this entry, found in this entry's text"},{"version":"2.1.242","anchor":"claude-checks-a-checkout-s-git-configuration-before-running-","heading":"Claude checks a checkout's git configuration before running git in it","line":"Claude inspects a synced checkout's git config first and refuses to run git there if it looks unsafe.","released_at":"2026-08-24 19:16:14","reason":"found in this entry's text"}],"entries_total":10,"docs":[{"source":"claude-code","path":"changelog","title":"Claude Code changelog","documented":false},{"source":"claude-code","path":"mcp","title":"Connect Claude Code to tools via MCP","documented":false},{"source":"claude-code","path":"plugin-evals","title":"Test plugins with evals","documented":false},{"source":"claude-code","path":"self-hosted-environments-configuration","title":"Customize sessions in self-hosted environments","documented":false}],"docs_total":4,"gates":[],"related":[{"name":"GIT_ALLOW_PROTOCOL","slug":"git-allow-protocol","description":"Git subprocesses now block graft files as an extra hardening measure"},{"name":"GIT_ASKPASS","slug":"git-askpass","description":"Git commands no longer hang forever on a Windows credential manager popup."},{"name":"GIT_CONFIG_COUNT","slug":"git-config-count","description":"Stray git environment variables in your shell can no longer misdirect worktree operations."},{"name":"GIT_CONFIG_GLOBAL","slug":"git-config-global","description":"Git calls in the sync path now respect your custom global and system config paths."},{"name":"GIT_CONFIG_NOSYSTEM","slug":"git-config-nosystem","description":"Plugin eval helpers ignore machine-wide git settings so results cannot be skewed."},{"name":"GIT_CONFIG_SYSTEM","slug":"git-config-system","description":"Git calls in the sync path now respect your custom global and system config paths."},{"name":"GIT_DIR","slug":"git-dir","description":"Stray git environment variables in your shell can no longer misdirect worktree operations."},{"name":"GIT_INDEX_FILE","slug":"git-index-file","description":"Stray git environment variables in your shell can no longer misdirect worktree operations."},{"name":"GIT_PROXY_COMMAND","slug":"git-proxy-command","description":"Every git command Claude runs now has hooks, filesystem monitors and prompt helpers turned off."},{"name":"GIT_SSH_COMMAND","slug":"git-ssh-command","description":"Git runs with strict host-key checking and risky protocols disabled, no matter your environment."}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/git-config","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}