Git 提交失败:“请使用 -m 或 -F 选项提供消息。”

A. *_*ssi 5 git git-commit

当我键入 git commit 命令来提交文件时,我收到以下错误消息:

Microsoft Visual Studio:微软:找不到命令

错误:核心编辑器“Microsoft Visual Studio”存在问题。

请使用 -m 或 -F 选项提供消息。

Von*_*onC 3

检查你的git config core.editor价值。
它可能指的是其中包含空格且不带引号的路径。

确保在注册该编辑器路径时使用简单引号:(
并在注册的所有命令表达式周围使用双引号。
并且使用“ /”而不是“ \”作为路径分隔符)

git config core.editor "'C:/path/with spaces/xxx.exe' -<someoptions>"
Run Code Online (Sandbox Code Playgroud)

例如,使用 Visual Studio Code 作为 git 编辑器时所做的事情。