Skip to content

Git fails to checkout remote branch with the same name as a local branch #60904

@RuntimeRascal

Description

@RuntimeRascal
  • VSCode Version: 1.29.0-insider (user setup)
  • OS Version: Windows 10 10.0.17134

more details - entire help entry
Version: 1.29.0-insider (user setup)
Commit: 931c220
Date: 2018-10-12T05:17:15.739Z
Electron: 2.0.11
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Steps to Reproduce:

  1. open vscode with a git controlled folder.
  2. from any branch select the scm icon in status bar to checkout a different branch and select origin/master in the command pallette popup while on say develop

Does this issue occur when all extensions are disabled?: Yes/No
Yes

this is the error I recieve
image

Here is the git log

> git checkout -q --track origin/master
fatal: A branch named 'master' already exists.
> git fetch
> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse develop
> git rev-parse --symbolic-full-name develop@{u}
> git rev-list --left-right develop...refs/remotes/origin/develop
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose

I normally do not use the insiders build but I installed it to test this out.

There may be a issue with my git for windows configuration and not vscode.
I recently updated my git for windows install and this problem started after the update.

If I simply execute git checkout master then the checkout works as expected it seems the problem only happens when using vscode scm features.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggitGIT issuesgood first issueIssues identified as good for first-time contributorshelp wantedIssues identified as good community contribution opportunitiesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions