Git提交失败:“请使用-m或-F选项提供消息." [英] Git commit fails: "Please supply the message using either -m or -F option."

查看:495
本文介绍了Git提交失败:“请使用-m或-F选项提供消息."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我输入git commit命令提交文件时,出现以下错误消息:

When I type the git commit command to commit my file, I get this error message:

Microsoft Visual Studio:Microsoft:找不到命令

Microsoft Visual Studio: Microsoft: command not found

错误:核心编辑器"Microsoft Visual Studio"出现问题.

error: there was a problem with the core editor 'Microsoft Visual Studio'.

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

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

推荐答案

检查您的git config core.editor值.
它可能指的是其中带有空格的路径,不带引号.

Check you git config core.editor value.
It might refer to a path with spaces in it, without quotes.

在注册该编辑器路径时,请确保使用简单的引号:
(并在所有已注册的命令表达式两边加上双引号.
并使用'/'代替'\'作为路径分隔符)

Make sure to use simple quotes when registering that editor path:
(And double quotes around the all command expression registered.
And '/' instead of '\' for the path separator)

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

使用例如Visual Studio Code作为git编辑器时完成的操作.

这篇关于Git提交失败:“请使用-m或-F选项提供消息."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆