What happened?
When Gemini CLI runs git commands in its execution sandbox, git fails with:
cannot spawn : No such file or directory
This is because the platform attempts to override and disable external diff tools by configuring diff.external to an empty string (""). Instead of disabling external diffing, Git's diff engine treats the empty string as the name of an external executable to spawn, causing it to fail.
What did you expect to happen?
Git commands should run successfully using the built-in, standard diff engine without attempting to spawn an empty-string executable.
Client information
Client Information
0.56.0-nightly.20260806.g761f604c1
Windows (win32)
Login information
No response
Anything else we need to know?
Root Cause
The platform injects several default Git configuration overrides through GIT_CONFIG_KEY_<N> and GIT_CONFIG_VALUE_<N> environment variables. Specifically, it maps:
diff.external -> "" (empty string)
In Git, setting diff.external to an empty string does not disable the setting; instead, it instructs Git to spawn "" as an external diff tool, which fails with cannot spawn : No such file or directory.
Responsible Code
packages/core/src/services/shellExecutionService.ts (line 520) in the defaultGitOverrides array:
packages/core/src/utils/gitUtils.ts (lines 44-45) in getSafeGitEnv():
GIT_CONFIG_KEY_7: 'diff.external',
GIT_CONFIG_VALUE_7: '',
Introducing Commit
The regression was introduced in the following commit:
- Commit:
c0d192452b4e2df7efb6d62a60385f475bfd6779
- Author: luisfelipe-alt luisfelipe@google.com
- Message:
fix(core): normalize git environment and resolve workspace state mismatch (#28792)
Proposed Resolution
Completely remove the diff.external overrides from the default overrides list and safe environment helper, allowing Git to use its built-in engine natively. If you want to make sure no external diff tool is used, call git diff --no-ext-diff.
What happened?
When Gemini CLI runs git commands in its execution sandbox, git fails with:
This is because the platform attempts to override and disable external diff tools by configuring
diff.externalto an empty string (""). Instead of disabling external diffing, Git's diff engine treats the empty string as the name of an external executable to spawn, causing it to fail.What did you expect to happen?
Git commands should run successfully using the built-in, standard diff engine without attempting to spawn an empty-string executable.
Client information
Client Information
0.56.0-nightly.20260806.g761f604c1
Windows (win32)
Login information
No response
Anything else we need to know?
Root Cause
The platform injects several default Git configuration overrides through
GIT_CONFIG_KEY_<N>andGIT_CONFIG_VALUE_<N>environment variables. Specifically, it maps:diff.external->""(empty string)In Git, setting
diff.externalto an empty string does not disable the setting; instead, it instructs Git to spawn""as an external diff tool, which fails withcannot spawn : No such file or directory.Responsible Code
packages/core/src/services/shellExecutionService.ts(line 520) in thedefaultGitOverridesarray:packages/core/src/utils/gitUtils.ts(lines 44-45) ingetSafeGitEnv():Introducing Commit
The regression was introduced in the following commit:
c0d192452b4e2df7efb6d62a60385f475bfd6779fix(core): normalize git environment and resolve workspace state mismatch (#28792)Proposed Resolution
Completely remove the
diff.externaloverrides from the default overrides list and safe environment helper, allowing Git to use its built-in engine natively. If you want to make sure no external diff tool is used, callgit diff --no-ext-diff.