Skip to content

Extension fails to detect PR branch when using gh co <PR> - v0.109.2025040408 #6761

@JeffreyCA

Description

@JeffreyCA

The GitHub Pull Requests extension sometimes fails to properly detect pull request branches after checking them out with gh co <prnr>. By "failing to detect" I mean that the "GitHub Pull Request" viewlet does not appear in the activity bar, and as a workaround I need to reload the extension host or restart VS Code.

There's a related issue #6378 (and corresponding fix #6755), but the fix seems to be specific to SSH remotes and the issue still repros for me.

Configuration

  • Extension version: 0.109.2025040408
  • VSCode Version: 1.99.0
  • OS: Windows 11
  • Repository Clone Configuration (single repository/fork of an upstream repository): Fork of upstream repository
  • Github Product (Github.com/Github Enterprise version x.x.x): Github.com

Steps to Reproduce

  1. git clone https://github.com/JeffreyCA/azure-dev (fork of https://github.com/Azure/azure-dev)
  2. cd azure-dev
  3. git remote add upstream https://github.com/Azure/azure-dev
  4. gh repo set-default - Choose Azure/azure-dev
  5. code . - Open in VS Code
  6. In VS Code terminal: gh pr checkout 5001 (Branch is from a different fork, https://github.com/vhvb1989/azure-dev)
    ✅ Extension correctly detects PR branch.
  7. In VS Code terminal: git checkout main.
    ✅ GitHub Pull Request disappears from activity bar.
  8. In VS Code terminal: gh pr checkout 5039 (From same fork as step 6 https://github.com/vhvb1989/azure-dev but different branch)
    ❌ Extension fails to detects PR branch.

To repro again, run git checkout main, delete the branches with git branch -D <branch-name>, then re-run a gh pr checkout command. (Sometimes I can repro again without deleting the branches.)

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions