Windows便携式Git集成到便携式Visual Studio Code中:应使用哪个git.exe?

3

很遗憾,我们无法安装Git或Visual Studio Code。因此使用两者的“便携式”版本。在Windows 10中寻找VS-code内的平滑“bash”集成

我们已经尝试了各种组合在git.path中,并在VS-Code的用户和工作区设置中添加了设置(如下所示)。

{
    "workbench.colorTheme": "Default Dark+",
    "git.ignoreMissingGitWarning": true,
    "git.enabled": true,
    "git.path": "C:\\installables\\PortableGit\\mingw64\\bin\\git.exe",
    "terminal.integrated.shell.windows": "C:\\installables\\PortableGit\\bin\\bash.exe"
}

Git Portable包含以下各处的git.exe文件。
./PortableGit/bin/git.exe
./PortableGit/cmd/git.exe
./PortableGit/mingw64/bin/git.exe
./PortableGit/mingw64/libexec/git-core/git.exe
./PortableGit/git-bash.exe
./PortableGit/git-cmd.exe
./PortableGit/mingw64/share/git/git-wrapper.exe

不确定哪个“git*.exe”是必需的,以便便携式VS Code可以集成到其 shell 中。有人有类似的设置吗?

1个回答

5

./PortableGit/bin/git.exe足够了。我将其与便携式的VSCode结合使用,没有问题。

另一种方法是正确设置路径,然后启动VSCode。

set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%

谢谢。上述 \PortableGit\bin\git.exe 可以使用。 "terminal.integrated.shell.windows" 显示了一个弃用警告。但希望稍后会研究一下。 - diaryfolio

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接