首页 > 解决方案 > 当我输入“git commit”时如何打开Atom

问题描述

当我键入git commitAtom 时应该打开,但它没有。

对于命令提示符上的配置,我键入:

config --global core.editor "atom --wait"

当我输入:

git commit

它说:

hint: waiting for your editor to close the file .......

error: there was a problem with the editor  "atom --wait"

Please supply the message using either -m or -F option.

标签: gitatom-editor

解决方案


正如“ Git 提交失败:“请使用 -m 或 -F 选项提供消息。”中解释的那样,您应该检查您的git config core.editor值。它可能指的是带有空格的路径,不带引号。

确保在注册该编辑器路径时使用单引号,并在所有注册的命令表达式周围使用双引号, '/'而不是'\'路径分隔符。

git config core.editor "'C:/path/with spaces/xxx.exe' -<someoptions>"

推荐阅读