Skip to content

Branch from default branch in cmux new, add --from flag#14

Open
midwire wants to merge 1 commit intocraigsc:mainfrom
midwire:feat/branch-from-default
Open

Branch from default branch in cmux new, add --from flag#14
midwire wants to merge 1 commit intocraigsc:mainfrom
midwire:feat/branch-from-default

Conversation

@midwire
Copy link

@midwire midwire commented Mar 5, 2026

Summary

  • cmux new now branches from the repo's default branch instead of the current HEAD
  • Default branch detected via git symbolic-ref refs/remotes/origin/HEAD, with main/master fallback
  • New --from <branch> flag to override the base branch

Test plan

  • cmux new <branch> while on a feature branch — verify it branches from main
  • cmux new <branch> --from <other> — verify it branches from specified branch
  • Repo with no main/master and no remote — verify helpful error message

cmux new previously branched from the current HEAD, which meant new
worktrees could accidentally branch from a feature branch. Now it
detects the repo's default branch (via remote HEAD, then main/master
fallback) and branches from that. Use --from <branch> to override.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant