git - 有没有办法让 VS 代码与 git worktree 一起工作? (带有 WSL 的 Windows)

标签 git visual-studio-code windows-subsystem-for-linux git-worktree

我喜欢使用 git worktree 在多个工作树中 check out 存储库,以便轻松地同时在不同分支上工作。 然而,当 git 位于 git worktree 文件夹中时,VS 代码似乎无法将 git 识别为 scm。

我在文档中找不到任何关于这个或扩展的内容。 关于如何让 VS 代码支持外部工作树中的 git 功能,有什么想法吗?

最佳答案

我认为这无关紧要,但事实证明...我在 Windows 上并在适用于 Linux 的 Windows 子系统中运行我的 git 命令行。但显然,Windows 上的 Git 无法在 /mnt/d... 中找到 linux 的绝对路径。

我将其替换为相对路径,现在 Linux 上的 Git 和 Windows 上的 Git 都报告工作树位于 git 目录中。它也适用于 VS 代码!

关于git - 有没有办法让 VS 代码与 git worktree 一起工作? (带有 WSL 的 Windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47076998/

相关文章:

html - Git 忽略某些文件的通配符添加

git - 比较分支时,有没有办法在 GitHub 中 "hide" merge 提交?

linux - 无法安装 "code": classic confinement requires snaps under/snap or symlink from/snap to/var/lib/snapd/snap

visual-studio-code - Visual Studio Code - 仅重复选择

python - pyenv install : 3. x BUILD FAILED (Ubuntu 20.04 using python-build 20180424)

git - 克隆 git 时 vagrant setup 抛出 Permission denied (publickey)

推送时 Git pull --rebase

python - 是否可以激活以 VSCode 路径为前缀的 conda 环境?

java - 是否可以在适用于 Linux (WSL) 的 Windows 子系统 - Ubuntu 上安装 IBM java?

c - memset 将一些元素设置为 *almost* 零或 nan