[FEATURE]: GitHub / Git Worktree & Branch Picker — open branch/worktree from Desktop/Web UI #9183

Open
opened 2026-02-16 18:11:50 -05:00 by yindo · 7 comments
Owner

Originally created by @bensheed on GitHub (Feb 12, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Willing to Pay / Sponsor This Feature

I am willing to financially support / sponsor development of this feature if needed.
This is a high-impact UX improvement that I would personally pay for.


Summary

OpenCode would benefit massively from a first-class GitHub repository + branch selection workflow built directly into the Desktop/Web UI.

Today, users must:

  • Manually create a local folder
  • Ask the agent to clone a repo
  • Open that folder afterward

This creates friction compared to other IDEs and coding agents. A native GitHub integration would allow users to select a repo, choose a branch, and have OpenCode automatically clone/pull and open the project, with future-proofing for richer Git worktree UX.


🎯 Goals

  • Allow users to connect GitHub via:
    • OAuth (like many IDEs)
    • Personal Access Token (like OpenHands)
    • Potentially reuse the same GitHub configuration used for GitHub Models
  • Browse public and private GitHub repositories
  • Select a branch before opening
  • Automatically:
    • Clone (or fetch)
    • Create/select a worktree
    • Open the project in OpenCode
  • Eliminate the need to manually pre-create a local folder
  • Lay the foundation for a future first-class worktree UI

🧠 Proposed UX (High-Level)

  1. User clicks “Open Repository” (or similar)
  2. OpenCode shows connected GitHub accounts
  3. User selects:
    • Repository
    • Branch
  4. OpenCode:
    • Creates an intelligent local folder structure
    • Pulls/clones the repo
    • Opens it immediately in the app

This mirrors workflows users already expect from modern IDEs and agent platforms.


📁 Local Filesystem & Folder Strategy

Because OpenCode relies on the local filesystem, some lightweight but intentional structure would be needed, for example:

~/opencode/
github/
org-name/
repo-name/
main/
feature-branch/

This also naturally supports:

  • Multiple branches
  • Git worktrees
  • Parallel agent workflows
  • Clear project/session separation

Worktree-Aware by Design (Future-Friendly)

This feature does not need to fully implement a worktree UI immediately, but it should:

  • Be compatible with git worktrees
  • Treat each branch/worktree as a distinct OpenCode project/session
  • Avoid overwriting or collapsing multiple worktrees into one project

Several existing issues show strong community interest in worktrees; this feature would serve as a UX entry point for those efforts.


Major Added Benefit: Private Repos

A key benefit not currently available:

  • OpenCode would gain native access to private GitHub repositories
  • This is increasingly important for professional and commercial usage
  • Token/OAuth support unlocks real-world workflows that aren’t possible today

Why This Is Not a Duplicate Request

There are several existing issues related to git worktrees and workspace handling, but none address:

  • GitHub account integration
  • Repo browsing in UI
  • Branch selection before opening
  • Automated clone + open workflows

This request sits above those issues as a UX and product-level feature that complements and unlocks them.


Related Issues

These issues demonstrate strong existing demand for better git/worktree handling and workspace UX:


Closing Thoughts

This feature would:

  • Dramatically reduce onboarding friction
  • Align OpenCode with user expectations set by modern IDEs
  • Unlock private repo workflows
  • Create a clean foundation for richer worktree UX in the future
Originally created by @bensheed on GitHub (Feb 12, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ## Willing to Pay / Sponsor This Feature I am willing to financially support / sponsor development of this feature if needed. This is a high-impact UX improvement that I would personally pay for. --- ### Summary OpenCode would benefit massively from a first-class **GitHub repository + branch selection workflow** built directly into the Desktop/Web UI. Today, users must: - Manually create a local folder - Ask the agent to clone a repo - Open that folder afterward This creates friction compared to other IDEs and coding agents. A native GitHub integration would allow users to **select a repo, choose a branch, and have OpenCode automatically clone/pull and open the project**, with future-proofing for richer Git worktree UX. --- ## 🎯 Goals - Allow users to **connect GitHub** via: - OAuth (like many IDEs) - Personal Access Token (like OpenHands) - Potentially reuse the same GitHub configuration used for GitHub Models - Browse **public and private GitHub repositories** - Select a **branch** before opening - Automatically: - Clone (or fetch) - Create/select a worktree - Open the project in OpenCode - Eliminate the need to manually pre-create a local folder - Lay the foundation for a future **first-class worktree UI** --- ## 🧠 Proposed UX (High-Level) 1. User clicks **“Open Repository”** (or similar) 2. OpenCode shows connected GitHub accounts 3. User selects: - Repository - Branch 4. OpenCode: - Creates an intelligent local folder structure - Pulls/clones the repo - Opens it immediately in the app This mirrors workflows users already expect from modern IDEs and agent platforms. --- ## 📁 Local Filesystem & Folder Strategy Because OpenCode relies on the local filesystem, some lightweight but intentional structure would be needed, for example: ~/opencode/ github/ org-name/ repo-name/ main/ feature-branch/ This also naturally supports: - Multiple branches - Git worktrees - Parallel agent workflows - Clear project/session separation --- ## Worktree-Aware by Design (Future-Friendly) This feature **does not need to fully implement a worktree UI immediately**, but it should: - Be compatible with git worktrees - Treat each branch/worktree as a distinct OpenCode project/session - Avoid overwriting or collapsing multiple worktrees into one project Several existing issues show strong community interest in worktrees; this feature would serve as a UX entry point for those efforts. --- ## Major Added Benefit: Private Repos A key benefit not currently available: - OpenCode would gain **native access to private GitHub repositories** - This is increasingly important for professional and commercial usage - Token/OAuth support unlocks real-world workflows that aren’t possible today --- ## Why This Is Not a Duplicate Request There are several existing issues related to git worktrees and workspace handling, but none address: - GitHub account integration - Repo browsing in UI - Branch selection before opening - Automated clone + open workflows This request sits **above** those issues as a UX and product-level feature that complements and unlocks them. --- ## Related Issues These issues demonstrate strong existing demand for better git/worktree handling and workspace UX: - https://github.com/anomalyco/opencode/issues/564 *(Git worktree integration)* - https://github.com/anomalyco/opencode/issues/6679 *(Multiple model usage with git worktrees)* - https://github.com/anomalyco/opencode/issues/2445 *(Git worktrees and root-directory detection)* - https://github.com/anomalyco/opencode/issues/10643 *(Worktrees created from bare repos not recognized)* - https://github.com/anomalyco/opencode/issues/5638 *(Desktop app: opening multiple git worktrees overwrites project)* - https://github.com/anomalyco/opencode/issues/1877 *(Root folder for aggregating sessions across subdirectories)* --- ## Closing Thoughts This feature would: - Dramatically reduce onboarding friction - Align OpenCode with user expectations set by modern IDEs - Unlock private repo workflows - Create a clean foundation for richer worktree UX in the future
yindo added the discussionweb labels 2026-02-16 18:11:50 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 12, 2026):

This issue might be a duplicate of or closely related to existing issues. Please check:

  • #10104: [FEATURE]: Add Extensive Project Support - addresses GitHub integration, repository cloning, and branch selection
  • #10785: [FEATURE]: GitHub integration with ChatGPT Subscription OAuth - covers GitHub OAuth integration

These issues all focus on improving GitHub integration workflows. Consider cross-referencing them and potentially collaborating on a unified solution.

@github-actions[bot] commented on GitHub (Feb 12, 2026): This issue might be a duplicate of or closely related to existing issues. Please check: - #10104: [FEATURE]: Add Extensive Project Support - addresses GitHub integration, repository cloning, and branch selection - #10785: [FEATURE]: GitHub integration with ChatGPT Subscription OAuth - covers GitHub OAuth integration These issues all focus on improving GitHub integration workflows. Consider cross-referencing them and potentially collaborating on a unified solution.
Author
Owner

@bensheed commented on GitHub (Feb 12, 2026):

This issue might be a duplicate of or closely related to existing issues. Please check:

These issues all focus on improving GitHub integration workflows. Consider cross-referencing them and potentially collaborating on a unified solution.

Yeah it looks like https://github.com/anomalyco/opencode/issues/10104 had the right idea but the PR ( https://github.com/anomalyco/opencode/pull/10107 ) was closed without merging

@bensheed commented on GitHub (Feb 12, 2026): > This issue might be a duplicate of or closely related to existing issues. Please check: > > * [[FEATURE]: Add Extensive Project Support #10104](https://github.com/anomalyco/opencode/issues/10104): [FEATURE]: Add Extensive Project Support - addresses GitHub integration, repository cloning, and branch selection > * [[FEATURE]: GitHub integration with ChatGPT Subscription OAuth #10785](https://github.com/anomalyco/opencode/issues/10785): [FEATURE]: GitHub integration with ChatGPT Subscription OAuth - covers GitHub OAuth integration > > These issues all focus on improving GitHub integration workflows. Consider cross-referencing them and potentially collaborating on a unified solution. Yeah it looks like https://github.com/anomalyco/opencode/issues/10104 had the right idea but the PR ( https://github.com/anomalyco/opencode/pull/10107 ) was closed without merging
Author
Owner

@iamhenry commented on GitHub (Feb 12, 2026):

def need this. hard to tell which branch im on in the gui

@iamhenry commented on GitHub (Feb 12, 2026): def need this. hard to tell which branch im on in the gui
Author
Owner

@syntheticgio commented on GitHub (Feb 13, 2026):

I agree this - especially with worktree support (I know this is more foundational) would be really helpful.

@syntheticgio commented on GitHub (Feb 13, 2026): I agree this - especially with worktree support (I know this is more foundational) would be really helpful.
Author
Owner

@syntheticgio commented on GitHub (Feb 13, 2026):

@bensheed I just discovered (thanks kind person on reddit!) that you can hover over the project name and there is a three dots menu available to the right of it (for the life of me I couldn't seem to find this). In there you can enable workspaces which might cover at least some of what you're requesting. Your request is more expansive but just wanted to give you the heads up in case you (like me) had missed this.

@syntheticgio commented on GitHub (Feb 13, 2026): @bensheed I just discovered (thanks kind person on reddit!) that you can hover over the project name and there is a three dots menu available to the right of it (for the life of me I couldn't seem to find this). In there you can enable workspaces which might cover at least some of what you're requesting. Your request is more expansive but just wanted to give you the heads up in case you (like me) had missed this.
Author
Owner

@iamhenry commented on GitHub (Feb 13, 2026):

right, on hover you should see something like the screenshot

Image

i would still love to be able to switch branches via some dropdown menu tho

@iamhenry commented on GitHub (Feb 13, 2026): right, on hover you should see something like the screenshot <img width="468" height="155" alt="Image" src="https://github.com/user-attachments/assets/9710ca7e-89a8-492b-abc7-b148a3de3c95" /> i would still love to be able to switch branches via some dropdown menu tho
Author
Owner

@kwickramasekara commented on GitHub (Feb 14, 2026):

+1. Definitely would love to be able to do the following:

  • Switch branch (at minimum)
  • Create new branches
  • Commit and push
@kwickramasekara commented on GitHub (Feb 14, 2026): +1. Definitely would love to be able to do the following: - Switch branch (at minimum) - Create new branches - Commit and push
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9183