Windows Portable Git 与 Portable Visual Studio Code 的集成:使用哪个 git.exe?

dia*_*lio 3 git visual-studio-code

不幸的是,我们无法安装 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"
}
Run Code Online (Sandbox Code Playgroud)

Git 便携版在以下各个位置都有 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
Run Code Online (Sandbox Code Playgroud)

不太确定,需要哪个“git*.exe”才能将可移植的 VS 代码集成到其 shell 中。有人有类似的设置/设置吗?

Von*_*onC 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%
Run Code Online (Sandbox Code Playgroud)