如何在git / macbook中将VScode设置为核心编辑器

问题描述 投票:0回答:1

我无法将Visual Studio代码设置为git的核心编辑器。当我尝试执行git提交时,我只看到编辑器存在问题的信息。

MacBook-Air-Agata:~ agataskrzypczyk$ git config --global core.editor "/Applications/Visual Studio Code.app" --wait

MacBook-Air-Agata:~ agataskrzypczyk$ git config --global core.editor
/Applications/Visual Studio Code.app

MacBook-Air-Agata:~ agataskrzypczyk$ cd nowy

MacBook-Air-Agata:nowy agataskrzypczyk$ git commit

hint: Waiting for your editor to close the file... /Applications/Visual Studio Code.app: /Applications/Visual: No such file or directory
error: There was a problem with the editor '/Applications/Visual Studio Code.app'.
Please supply the message using either -m or -F option.
MacBook-Air-Agata:nowy agataskrzypczyk$
git visual-studio-code
1个回答
2
投票

我建议您将Visual Studio Code选项设置为从命令行启动。为此,请遵循文档here中的说明。

  • 启动VS Code。
  • 打开命令选项板(⇧⌘P)并键入“shell命令”以在PATH命令中查找Shell命令:安装'code'命令。

然后尝试使用以下命令设置核心编辑器:

git config --global core.editor "code --wait"

然后我认为你不会遇到git commit的问题。

© www.soinside.com 2019 - 2024. All rights reserved.