8000 Git fails to checkout remote branch with the same name as a local branch · Issue #60904 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RuntimeRascal opened this issue Oct 14, 2018 · 7 comments · Fixed by #61149
Closed

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

RuntimeRascal opened this issue Oct 14, 2018 · 7 comments · Fixed by #61149
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities verified Verification succeeded
Milestone

Comments

@RuntimeRascal
Copy link
  • 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.

@vscodebot vscodebot bot added the insiders label Oct 14, 2018
@joaomoreno joaomoreno changed the title Git SCM fails to checkout branches Git fails to checkout remote branch with the same name as a local branch Oct 17, 2018
@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities git GIT issues good first issue Issues identified as good for first-time contributors and removed insiders labels Oct 17, 2018
@joaomoreno joaomoreno added this to the Backlog milestone Oct 17, 2018
@jacobherrington
Copy link
jacobherrington commented Oct 17, 2018

Not actually sure how to recreate the issue, but the Git error is caused by the --track argument. It's fairly easy to find where it's being set in git.d.ts.

@joaomoreno
Copy link
Member

Issue happens because Code tries to checkout origin/master. We should check whether there's a local branch which already has origin/master as an upstream and just checkout that branch instead.

@skprabhanjan
Copy link
Contributor

Issue happens because Code tries to checkout origin/master. We should check whether there's a local branch which already has origin/master as an upstream and just checkout that branch instead.

@joaomoreno , Can I take a look at this?

@RuntimeRascal
Copy link
Author
RuntimeRascal commented Oct 18, 2018 via email

@joaomoreno
Copy link
Member
joaomoreno commented Oct 19, 2018

@skprabhanjan Feel free to just jump on any help wanted issue any time.

@simpert There's already a PR open to fix this.

@DavidGerva
Copy link

@joaomoreno I would like to start help with some issue. I found this one but I also see that the PR for the issue #61149 should fix also this but there are conflicts to be solved before merge.

If I'm right, can I do something to help with these issue? I see these issue blocked since a few months...

@joaomoreno joaomoreno modified the milestones: Backlog, May 2019 May 27, 2019
@lramos15 lramos15 added the verified Verification succeeded label May 30, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities verified Verification succeeded
Projects
None yet
6 participants
0