Skip to content

new workspace always branches from the current head #39778

Closed

Description

@ProdigyRahul

describe the bug

creating a new workspace (worktree) always branches from the current head of the project checkout.

the branch chip in the new session bar is display only. there is no way to pick the base branch before creating the workspace.

git worktree add --no-checkout -b <branch> <dir> is invoked with no start point, so whatever branch you happen to be sitting on becomes the base. if you are on a feature branch, the new workspace silently inherits it.

expected behavior

  • the branch chip should be clickable
  • clicking it should list local and remote branches with search
  • in new workspace mode the selected branch becomes the base ref for git worktree add
  • with no selection the workspace should branch from the repo default branch, not the current head
  • in local or existing workspace mode selecting a branch should check it out

screenshots

(screenshots to be added)

environment

  • desktop app, dev build, new layout
  • macos

Activity

  1. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

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

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up, @ProdigyRahul!

    Since this was filed, the desktop app's new-session bar has gained a base-branch picker. In New Workspace mode the branch chip now shows from <branch>. Clicking it opens a searchable branch list, and the branch you pick is used as the start point when the worktree is created. So on a current v2 build you should be able to choose the base branch.

    Two parts of your request work differently today:

    • With no branch selected, a new workspace starts from the project checkout's current branch, not the repo's default branch.
    • In Local or existing-workspace mode the chip only shows the branch; you can't use it to check out a different one.

    That's how it's designed right now, so I'm treating these as a feature request. Maintainers will consider them.

    Related issues:

    If you still can't pick a base branch on a current v2 build, please reply with your opencode --version and a screenshot.

  3. neriousy commented on Nov 13, 2026

    @neriousy
    Member

    Closing as completed. Since #44906, New Workspace has a "from " picker, and the worktree is created from the branch you choose. #60263 and #60579 made the picker easier to reach. Without a choice, the base is still the current HEAD. Defaulting to the repo's default branch, or checking out the chosen branch in Local mode, would be new feature requests. The blank-picker bug is tracked in #51072.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions