【问题标题】:How can I associate bash command to Git Bash instead of WSL Bash?如何将 bash 命令关联到 Git Bash 而不是 WSL Bash?
【发布时间】:2020-11-18 02:47:37
【问题描述】:

我安装了 Git Bash 和 WSL Bash。当前 bash 命令与 WSL Bash 相关联。我可以将其链接到 Git bash 吗?

【问题讨论】:

    标签: windows-10 git-bash windows-subsystem-for-linux


    【解决方案1】:

    我自己研究后想通的。

    在 PowerShell 中,您可以将 bash 命令与 Git Bash 相关联

    Set-Alias -Name bash -Value "C:\Program Files\Git\usr\bin\bash.exe"
    

    但它只会对您运行命令的 PowerShell 会话有效。

    【讨论】:

    • 有什么方法可以在脚本中进行这项工作吗?它似乎只在直接使用命令时有效
    猜你喜欢
    • 2016-06-19
    • 2022-01-19
    • 2020-09-18
    • 2016-08-16
    • 2019-06-26
    • 2018-05-21
    • 1970-01-01
    • 1970-01-01
    • 2012-01-23
    相关资源
    最近更新 更多