【问题标题】:Associating Visual Studio Code with Git in Mac在 Mac 中将 Visual Studio Code 与 Git 关联
【发布时间】:2019-05-19 17:47:51
【问题描述】:

我想将我的默认git编辑器配置为Visual Studio Code,但配置后我得到以下错误然后使用它:

username ~ $ git config --global core.editor "code --wait"
username ~ $ git config --global -e
hint: Waiting for your editor to close the file... code --wait: code: command not found  
error: There was a problem with the editor 'code --wait'.

我不知道如何解决它...你知道我该怎么做吗?

谢谢!!

【问题讨论】:

标签: git macos visual-studio-code


【解决方案1】:

在您的 VSCode 上,

SHIFT+命令+P

Shell 命令:在 PATH 中安装“代码”命令

它将'code'设置为vscode的可执行路径。

现在在终端下面运行:

git config --global --edit

【讨论】:

    【解决方案2】:

    这是因为code 命令未添加到 PATH 中。按照以下步骤在 PATH 中添加code 命令:

    1. 请按SHIFT+Command+P
    2. 出现一个输入字段。输入 code install 和一个选项

    Shell 命令:在 PATH 中安装 'code' 命令`

    出现。点击那个。

    1. code 命令被添加到 PATH。

    【讨论】:

      猜你喜欢
      • 2019-01-31
      • 1970-01-01
      • 2021-08-09
      • 2017-07-08
      • 1970-01-01
      • 2021-09-17
      • 2013-05-18
      • 2018-12-28
      • 1970-01-01
      相关资源
      最近更新 更多