【问题标题】:Visual Studio Code: Use Git Bash (windows)Visual Studio Code:使用 Git Bash(Windows)
【发布时间】:2017-11-23 11:31:06
【问题描述】:

我发现了一些问题,这些问题为将 Git Bash 与完整的 Visual Studio 结合使用提供了指导,但我无法找到有关如何设置 Visual Studio Code 提供的内置终端的任何指导成为 Git Bash。这可能吗?

【问题讨论】:

    标签: visual-studio-code git-bash


    【解决方案1】:

    您的工作区有以下设置:

    // 终端在 Windows 上使用的 shell 的路径。使用 Windows 附带的 shell(cmd、PowerShell 或 Ubuntu 上的 Bash)时,更喜欢 C:\Windows\sysnative 而不是 C:\Windows\System32 以使用 64 位版本。

    "terminal.integrated.shell.windows":  “C:\\Windows\\sysnative\\bash.exe”,
    

    假设您已经安装了它。我在这里找到了这个信息:

    installing and setting up git bash in vscode

    【讨论】:

      【解决方案2】:

      接受的答案没有回答原始问题:如何在 VS Code 中使用 git-bash。

      "terminal.integrated.shell.windows":  "C:\\Git\\bin\\bash.exe"
      

      只需将 C:\Git 文件夹的路径替换为 git 安装的实际路径即可。

      【讨论】:

        【解决方案3】:

        我不确定是否可以将内置终端设置为 Git Bash。在您的项目根目录中打开一个 Git Bash 终端就足够了。

        您可以通过右键单击打开的目录并单击“Git Bash Here”来执行此操作。

        【讨论】:

        • 这是可能的,而且效果很好。 Git Bash 按预期在所选目录中打开。
        猜你喜欢
        • 1970-01-01
        • 2020-02-27
        • 2017-07-03
        • 1970-01-01
        • 2021-10-12
        • 2020-12-11
        • 1970-01-01
        • 2018-05-08
        • 2017-07-25
        相关资源
        最近更新 更多