Repository navigation
[Feature]: Allow configuring the default base branch for new worktree threads #6866
Replies: 7 comments
|
I'd like to choose a base such as I opened #13592 with a Worktree base ref setting: repository default, a specific branch/tag/commit, or Last used. Last used remembers explicit selections per project and environment on the current device; that behavior is adapted from #11991 by @Nortus222. Existing drafts and one-off branch choices keep their selection, and Start from origin still applies independently. The PR includes screenshots and validation details for the web and mobile changes. Would maintainers want this scope, or prefer a smaller version with just a fixed base per project? If the approach fits, the PR's CI is waiting for maintainer approval. |
|
+1 — I'd like new worktree threads to always start from the repository default branch ( Note: #13592, the PR implementing this, was closed without merging, so this is still unaddressed. |
|
@juliusmarminge #13598 was closed as not planned, but this discussion is still in triage and people keep asking for it (9 upvotes, most recently @rutmehta). Would you accept a smaller version than #16451? I've opened #25942 so you can judge it from the code. It adds one setting for where new worktrees branch from: the repository default, or a branch you pick, like |
|
+1, and I'd like the Current branch option from the list above to survive into whatever lands. My case is the opposite of the original one: for a few days or weeks, work focuses on a long-lived branch that isn't the default (for example It would also make the composer consistent with agents: worktrees created through the worktree MCP tools without a Suggested modes, with the repository default kept as the default: repository default / current branch of the project checkout / configured branch. An explicit pick in the branch chip still wins, and Start from origin still applies. (Closing my #27659 as a duplicate of this.) |
|
Update: #25942 was closed for missing verification, so I reopened it as #29506 with the evidence, and a maintainer has since verified it in a real dev environment. It adds Settings → Worktrees → Base branch, a branch picker you can set per project. New worktrees start from that branch, and switching a draft from Current checkout to New worktree uses it too. #29505 is a small branch-picker fix it builds on. @guryanov-a, for your case you could set the project's base to |
That's rather a workaround, git's current branch (which changes with |
|
I need this for a workflow where Please allow saving a default worktree base branch globally, with a per-project override. For example, setting a project's base to The workspace choice should stay independent: some threads need a new worktree, while others should use the current checkout or reuse an existing worktree. Choosing Current checkout is not a substitute for selecting the default base of a new worktree. Observed on T3 Code 0.1.8-nightly.20261108.4353 on macOS. |
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/web
Problem or use case
I use T3 Code with New threads → New worktree and Start from origin enabled.
When I create a new thread while viewing an existing thread on a feature branch, the base branch picker inherits that thread's branch, for example:
From agent/month-view-all-day-defaultFor unrelated tasks, I want each new worktree thread to start from the repository's default branch, usually
main. Today I must manually selectmainfor every new thread. This makes it easy to accidentally base an unrelated task on a previous feature branch.Proposed solution
Add a setting for the default base branch used by new worktree threads.
Suggested options:
origin/HEAD, usuallymain)My preferred default is Repository default branch.
This should be independent of the existing settings:
The branch picker should remain available for one-off overrides.
Why this matters
A new thread often represents a new, unrelated task. Inheriting the currently viewed feature branch is useful for follow-up work, but surprising and potentially unsafe for independent work.
A predictable workflow would be:
This would reduce accidental branch dependencies.
Smallest useful scope
Add a global setting with two options:
Use it to initialize the base-branch picker for a new worktree draft. A per-project override could be added later.
Alternatives considered
mainworks, but is repetitive and easy to forget.maindoes not fully solve the problem because the picker can inherit the branch of the currently viewed thread.Risks or tradeoffs
Some users intentionally create new threads as follow-ups to the active feature branch. Changing the behavior unconditionally could disrupt that workflow.
Making it configurable preserves both workflows.
Examples or references
Observed on T3 Code Alpha 0.0.31 on macOS.
Current settings:
Related but distinct: #1111 discusses syncing a selected base branch from origin. This request concerns which base branch is selected by default.
Contribution
All reactions