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

wrong branch with git worktree #165319

Closed
Obdormio opened this issue Nov 3, 2022 · 4 comments
Closed

wrong branch with git worktree #165319

Obdormio opened this issue Nov 3, 2022 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@Obdormio
Copy link

Obdormio commented Nov 3, 2022

Type: Bug

mkdir main && cd main
git init .
echo a >> a
git commit . -m 'init'
git worktree add -b dev ../dev # important!
code ../dev

VS Code version: Code 1.73.0 (8fa188b, 2022-11-01T15:38:50.881Z)
OS version: Darwin x64 21.6.0
Modes:
Sandboxed: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 5, 4, 4
Memory (System) 32.00GB (2.68GB free)
Process Argv --crash-reporter-id 3a52e803-02cd-4b3d-8776-2210bf391da2
Screen Reader yes
VM 0%
Extensions (39)
Extension Author (truncated) Version
better-toml bun 0.3.2
postcss css 1.0.9
dart-code Dar 3.52.1
flutter Dar 3.52.0
vscode-eslint dba 2.2.6
vscode-deno den 3.14.0
gitlens eam 13.0.3
prettier-vscode esb 9.9.0
filter-line eve 2.0.1
beautify Hoo 1.5.0
gkd Hot 0.2.27
svg joc 1.4.22
vscode-codemetrics kis 1.24.0
git-graph mhu 1.30.0
vscode-less mrm 0.6.3
vscode-scss mrm 0.10.0
vscode-language-pack-zh-hans MS- 1.73.11020948
remote-containers ms- 0.255.4
remote-ssh ms- 0.90.1
remote-ssh-edit ms- 0.84.0
cmake-tools ms- 1.12.27
cpptools ms- 1.12.4
cpptools-extension-pack ms- 1.3.0
room-ext Obd 0.0.3
material-icon-theme PKi 4.21.0
polacode pnp 0.3.4
fabric8-analytics red 0.3.6
java red 1.12.0
vscode-xml red 0.22.0
rust-analyzer rus 0.4.1271
code-spell-checker str 2.10.1
even-better-toml tam 0.19.0
cmake twx 0.0.17
intellicode-api-usage-examples Vis 0.2.6
vscodeintellicode Vis 1.2.29
vscode-java-debug vsc 0.46.0
vscode-java-pack vsc 0.25.4
vscode-maven vsc 0.39.2
vscode-proto3 zxh 0.5.5

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vscaac:30438847
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
pyindex848cf:30577861
nodejswelcome1:30587005
fc301958:30595537
3d0df643:30602300

@Obdormio
Copy link
Author

Obdormio commented Nov 3, 2022

image

@SE2Dev
Copy link

SE2Dev commented Nov 3, 2022

Also if you use the VSCode UI to switch branches in a worktree, it will actually checkout the target branch (which can be confirmed via the integrated console), but the UI won't change.

@steelerc69
Copy link

IF you use any of the status bar items (git pull, git synch, etc.) it uses the WRONG branch from what you are in and you end up with a "merge" from the branch that VSCode "thinks" you are in and NOT the real branch shown in the console!

@lszomoru
Copy link
Member

lszomoru commented Nov 4, 2022

Closing as duplicate of #164363

@lszomoru lszomoru closed this as completed Nov 4, 2022
@lszomoru lszomoru added the *duplicate Issue identified as a duplicate of another issue(s) label Nov 4, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

5 participants