How to work with Git worktree in VS-code?

Viewed 2809

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 ?

2 Answers

tips: make sure your command line is in the root directory of the repository.

use $git remote and the command line should at least say origin

VScode has an icon on the left (looks like lines with circle endpoints) that shows current workingtree branch changes.

https://www.youtube.com/watch?v=USjZcfj8yxE

Related