我无法将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$
我建议您将Visual Studio Code选项设置为从命令行启动。为此,请遵循文档here中的说明。
然后尝试使用以下命令设置核心编辑器:
git config --global core.editor "code --wait"
然后我认为你不会遇到git commit
的问题。