Skip to content

Checkout branch fails if branch exists in remote, but not in local #823

@cambot

Description

@cambot

If a developer opens up a pull request that another wishes to load into their local instance, "Check out existing branch" on its own will fail with the error "Selected branch does not exist". While SourceControl.Git.Utils.SwitchBranch() does check the list of remote branches (git branch -a) before attempting the check out, the local list could be stale.

A work around is possible by first running the "Fetch from Remote" menu item because that action currently fetches all remote branches, not just the checked out branch.

To avoid this potentially confusing scenario, I think SwitchBranch() should should be updated to run git fetch --prune before running git branch -a


Module Version: 2.12.2

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