You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for example if the default branch of a repository is main and someone opens a PR from their fork with their branch being username:main the wt switch pr:1234 command errors with: ✗ Branch main exists but doesn't track PR #1234
yes I agree, if they do use the default branch name then it's a problem!
this is very much a tradeoff (somewhat mentioned here, would appreciate thoughts:
we want to be able to git push to the PR, as a maintainer
we don't want to pollute local git config with added remotes
we want to be able to switch to a PR that has a conflicting branch name (your point)
unfortunately it's not possible to have all three of those; git requires a named remote if the branch name doesn't match, frustratingly (I spent a decent amount of time researching this, though would obv love to be proved wrong)
so we could:
always make a unique branch, always add the remote (maybe most standard?)
only when there's a conflict make a unique branch name + add the remote (maybe the most DWIM, but inconsistent)
some other creative solution?
(would really prefer not to get around this by adding a config, which is often the temptation...)
Activity
max-sixty commentedon Jan 18, 2026
can you explain more? wdym "they don't use the default branch name"?
vimtor commentedon Jan 18, 2026
for example if the default branch of a repository is
mainand someone opens a PR from their fork with their branch beingusername:mainthewt switch pr:1234command errors with: ✗ Branch main exists but doesn't track PR #1234max-sixty commentedon Jan 18, 2026
yes I agree, if they do use the default branch name then it's a problem!
this is very much a tradeoff (somewhat mentioned here, would appreciate thoughts:
git pushto the PR, as a maintainerunfortunately it's not possible to have all three of those; git requires a named remote if the branch name doesn't match, frustratingly (I spent a decent amount of time researching this, though would obv love to be proved wrong)
so we could:
(would really prefer not to get around this by adding a config, which is often the temptation...)
feat: use prefixed branch name for conflicting fork PR branches
feat: use prefixed branch name for conflicting fork PR branches (#779)