Skip to content

Desktop app merges separate directories of the same Git repo into one project #29869

@FQXCS

Description

@FQXCS

Description

When adding projects in the desktop app, two different local directories that point to the same Git repository are merged into a single project. One directory becomes the main project worktree, and the other directory is shown/treated as a sandbox.

This is unexpected. In the desktop app, each added directory should appear as an independent project, even if both directories use the same Git remote or represent different branches of the same repository.

Plugins

OpenCode version

1.15.12

Steps to reproduce

  1. Clone the same Git repository into two different local directories.
  2. Checkout a different branch in each directory.
  3. Open the desktop app.
  4. Add the first directory as a project.
  5. Add the second directory as another project.

Actual Behavior

The desktop app merges both directories into one project.

The first added directory becomes the main project, while the second directory is treated as a sandbox of that project.

Expected Behavior

The desktop app should show both directories as separate projects.

Projects in the desktop app should be distinguished by their local directory path, not only by Git repository identity, remote URL, or shared Git metadata.

Why This Matters

It is common to keep multiple checkouts of the same repository in different directories, especially when working on multiple branches at the same time.

Treating one checkout as a sandbox makes it harder to manage them independently in the desktop app.

Suggested Fix

The app could use git worktree list to distinguish linked Git worktrees from separate clones/checkouts.

Proposed behavior:

  • If two directories are part of the same git worktree setup, merging them into one project with sandboxes makes sense.
  • If two directories are separate clones or separate local checkouts of the same remote repository, they should be shown as two independent projects.
  • In other words, sharing the same Git remote should not be enough to merge projects. The merge should only happen when Git reports the directories as linked worktrees of the same repository.

This would preserve the current sandbox behavior for real Git worktrees while avoiding accidental merging of unrelated local directories.

Screenshot and/or share link

Image

Operating System

window 10

Terminal

Windows Terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions