gemini-cli - ✅(Solved) Fix Gemini CLI fails with locally-compiled Git [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25034Fetched 2026-04-10 03:45:09
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3added_to_project_v2 ×1issue_type_added ×1unlabeled ×1

Error Message

========================================= This is an unexpected error. Please file a bug report using the /bug tool. CRITICAL: Unhandled Promise Rejection!

Reason: Error: Failed to initialize checkpointing: Error: spawn git ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:89:21). Please check that Git is working properly or disable checkpointing. Stack trace: Error: Failed to initialize checkpointing: Error: spawn git ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:89:21). Please check that Git is working properly or disable checkpointing. at _GitService.initialize (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:319248:13) at async Config.getGitService (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:350228:7) at async Config._initialize (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:348879:7) at async file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-QUKUV3RI.js:48343:9 Authenticated via "oauth-personal".

PR fix notes

PR #25115: fix(core): preserve PATH for checkpointing git setup

Description (problem / solution / changelog)

Fixes #25034

Preserve the process environment when configuring simple-git for checkpointing so PATH is not dropped while still overriding the shadow repo git config.

Tests:

  • npx vitest run src/services/gitService.test.ts
  • npx vitest run checkpointing.test.ts

Changed files

  • packages/cli/src/ui/hooks/slashCommandProcessor.test.tsx (modified, +36/-0)
  • packages/cli/src/ui/hooks/slashCommandProcessor.ts (modified, +12/-5)
  • packages/core/src/services/gitService.test.ts (modified, +13/-0)
  • packages/core/src/services/gitService.ts (modified, +1/-0)

PR #25328: fix(core): merge process.env into shadow repo environment

Description (problem / solution / changelog)

Fixes #25034. The checkpointing git service would override process.env entirely, dropping the user's PATH.

Changed files

  • packages/core/src/services/gitService.ts (modified, +1/-0)

Code Example

=========================================
This is an unexpected error. Please file a bug report using the /bug tool.
CRITICAL: Unhandled Promise Rejection!
=========================================
Reason: Error: Failed to initialize checkpointing: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21). Please check that Git is working properly or disable checkpointing.
Stack trace:
Error: Failed to initialize checkpointing: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21). Please check that Git is working properly or disable checkpointing.
    at _GitService.initialize (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:319248:13)
    at async Config.getGitService (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:350228:7)
    at async Config._initialize (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:348879:7)
    at async file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-QUKUV3RI.js:48343:9
Authenticated via "oauth-personal".

---

> /about
# paste output here
About Gemini CLI│                                                                                                                                                                                                                                            │
CLI Version                                                                       0.37.0Git Commit                                                                        352bbe149                                                                                                                                                │
Model                                                                             gemini-3-flash-preview                                                                                                                                   │
Sandbox                                                                           no sandbox                                                                                                                                               │
OS                                                                                linux                                                                                                                                                    │
Auth Method                                                                       Signed in with Google (***@gmail.com)Tier                                                                              Gemini Code Assist for individuals
RAW_BUFFERClick to expand / collapse

What happened?

Upon upgrading to 0.36.0/0.37.0, Gemini CLI cannot be used anymore, failing with the following error at startup:

=========================================
This is an unexpected error. Please file a bug report using the /bug tool.
CRITICAL: Unhandled Promise Rejection!
=========================================
Reason: Error: Failed to initialize checkpointing: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21). Please check that Git is working properly or disable checkpointing.
Stack trace:
Error: Failed to initialize checkpointing: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21). Please check that Git is working properly or disable checkpointing.
    at _GitService.initialize (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:319248:13)
    at async Config.getGitService (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:350228:7)
    at async Config._initialize (file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/chunk-JCJR4TJP.js:348879:7)
    at async file:///home/erdavila/Apps/node-v24.13.0-linux-x64/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-QUKUV3RI.js:48343:9
Authenticated via "oauth-personal".

What did you expect to happen?

Gemini CLI should work with whatever Git is available via the PATH environment variable.

Client information

My system is Linux Mint 22.2.

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
About Gemini CLI                                                                                                                                                                                                                           │
│                                                                                                                                                                                                                                            │
│ CLI Version                                                                       0.37.0                                                                                                                                                   │
│ Git Commit                                                                        352bbe149                                                                                                                                                │
│ Model                                                                             gemini-3-flash-preview                                                                                                                                   │
│ Sandbox                                                                           no sandbox                                                                                                                                               │
│ OS                                                                                linux                                                                                                                                                    │
│ Auth Method                                                                       Signed in with Google (***@gmail.com)                                                                                                               │
│ Tier                                                                              Gemini Code Assist for individuals
</details>

Login information

Google Account

Anything else we need to know?

I have a locally-compiled Git version (unchanged; obtained directly from the the master branch at https://github.com/git/git.git). The binary is at ~/bin. The path ~/bin is included in the PATH environment variable. The command gemini fails in the same terminal session where I can use the locally-compiled Git. Gemini CLI worked fine before upgrading to 0.36.0. I don't know which version I used before upgrading to 0.36.0. Gemini CLI was upgraded with the npm install -g @google/gemini-cli command

Gemini CLI can be used if I install git via the apt install git command.

extent analysis

TL;DR

The Gemini CLI fails to initialize due to an issue with the locally-compiled Git version, and a potential workaround is to install Git via the package manager.

Guidance

  • Verify that the locally-compiled Git version is correctly installed and accessible via the PATH environment variable.
  • Try installing Git via the package manager (e.g., apt install git) to see if it resolves the issue.
  • Check the PATH environment variable to ensure that the locally-compiled Git binary is correctly referenced.
  • Consider filing a bug report using the /bug tool as suggested in the error message.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The issue may be specific to the locally-compiled Git version or the interaction between Gemini CLI and the custom Git installation. Further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Install Git via the package manager (e.g., apt install git) as it has been reported to resolve the issue. This is a temporary solution until the root cause is identified and addressed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING