Skip to content

Improve support for GitHub fork PRs #714

Closed

Description

@vimtor

when people contribute to a fork sometimes they don't use the default branch name which causes conflicts when trying to do wt switch pr:1234

Activity

  1. max-sixty commented on Jan 18, 2026

    @max-sixty
    Owner

    can you explain more? wdym "they don't use the default branch name"?

  2. vimtor commented on Jan 18, 2026

    @vimtor
    Author

    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

  3. max-sixty commented on Jan 18, 2026

    @max-sixty
    Owner

    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...)

  4. added a commit that references this issue on Jan 21, 2026
    131dc60
  5. added a commit that references this issue on Jan 21, 2026
    bd4fa4b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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