gemini-cli - 💡(How to fix) Fix Start gemini in existing worktree folder [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#25029Fetched 2026-04-10 03:45:13
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×3issue_type_added ×1parent_issue_added ×1unlabeled ×1
RAW_BUFFERClick to expand / collapse

What would you like to be added?

Command gemini -w worktree creates worktree worktree in .gemini/worktrees/worktrees.

creates worktree but when it is run second time it tells there is already a worktree while it could run gemini in wokrtree folder.

Why is this needed?

It is simpler to write gemini -w worktree instead of cd .gemini/worktrees/worktree && gemini, not saying that latter is using internal desing of gemini that can change in future.

Additional context

No response

extent analysis

TL;DR

The issue can be resolved by modifying the gemini -w worktree command to handle existing worktrees or by using a different approach to run gemini in the worktree folder.

Guidance

  • Check if the worktree already exists before running the gemini -w worktree command to avoid conflicts.
  • Consider using a flag or option to force the creation of a new worktree or to reuse an existing one.
  • Run gemini directly in the worktree folder using cd .gemini/worktrees/worktree && gemini as a temporary workaround.
  • Investigate the internal design of gemini to determine if there's a more robust way to handle worktree creation and management.

Notes

The current implementation of gemini -w worktree does not handle existing worktrees, leading to errors when run multiple times. The desired behavior is to simplify the process of creating and managing worktrees.

Recommendation

Apply workaround: use cd .gemini/worktrees/worktree && gemini until a more robust solution is implemented, as it allows for running gemini in the worktree folder without conflicts.

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