如何在 VS-code 中使用 Git 工作树?

Skr*_*att 11 git branch visual-studio git-worktree

有件事我很难理解:

如何在 VS-code 中使用 git worktrees ?

我显然无法让它发挥作用。

我尝试过使用命令行...但是当我尝试签出所需的分支时,它告诉我:

错误:命令失败:C:\Program Files\Git\cmd\git.exe -c core.longpaths=true -c core.quotepath=false -c color.ui=false 结帐序列 --

致命:“序列”已在以下位置检出

当我在命令行中更改文件夹时,就像在很多视频中(在 vs-code 之外)一样......它保持相同的分支签出。

有人可以帮助我或向我指出一个资源/博客来指示如何继续或如何配置以使 git worktree 与 vs-code 一起使用吗?

Leu*_*ria 2

您可以从终端检查您的问题 https://github.com/microsoft/vscode/issues/68038 ,您可以工作

使用 git worktree...

git --bare
git worktree list
git worktree add <branch>
git worktree remove <branch>
...
Run Code Online (Sandbox Code Playgroud)

更远...

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