Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to work with Git worktree in VS-code?

Something I'm having a hard time to understand:

how do I work with git worktrees in VS-code ?

I apparently cannot make it work.

I've tried using the command line ... but then when I try to checkout to the desired branch, it tells me:

Error: Command failed: C:\Program Files\Git\cmd\git.exe -c core.longpaths=true -c core.quotepath=false -c color.ui=false checkout sequences --

fatal: 'sequences' is already checked out at

and when I change folder in command line like on so many videos (outside of vs-code) ... it stays with the same branch check-out.

Can somebody help me out or point me to a resource / blog that indicate how to proceed or how to configure to get git worktree working with vs-code ?

like image 742
Skratt Avatar asked Feb 15 '26 05:02

Skratt


1 Answers

you can check this issue for your question https://github.com/microsoft/vscode/issues/68038 from terminal you can work

working with git worktree...

git --bare
git worktree list
git worktree add <branch>
git worktree remove <branch>
...

further...

https://git-scm.com/docs/git-worktree#:~:text=In%20its%20simplest%20form%2C%20git,at%20path%20..%2Fhotfix%20.

like image 76
LeulAria Avatar answered Feb 16 '26 21:02

LeulAria



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!