由于空提交消息而中止提交 [英] Aborting commit due to empty commit message

查看:127
本文介绍了由于空提交消息而中止提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为新手git用户,当我尝试使用

  git commit -a -v 

然后我在我的编辑器中输入一条提交信息,我关闭了这个文件,并得到这个错误:

 由于空提交消息而中止提交。 

我已经阅读了几乎所有解决这个问题的主题,改变了编辑器,基本上尝试了一切,但没有任何帮助。我应该怎么做?



有一件事我注意到,在使用notepad ++的整个过程中,文件无法保存。



可能的解决方法是:

  git commit -am SomeComment

但是通过这样做我觉得我有点使用git的目的。我想正确记录我的更改。

解决方案

当您在Git的配置中设置编辑器时, -w强制Git等待你的提交信息,你可以在你的自定义编辑器中输入。

  git config --global core.editor[your editor] -w


As a newbie git user, when I try to commit my work with

git commit -a -v

and I enter a commit message in my editor, I close the file, and get this error:

Aborting commit due to empty commit message.

I have read nearly all the topics addressing to this issue, changed editors, basically tried everything but nothing helps. What should I do?

One thing I noticed, while trying the whole process with notepad++, the file couldn't be saved.

A possible workaround is this:

git commit -am "SomeComment"

But by doing so I feel I am kind of nullifying the purpose of using git. I want to properly document my changes.

解决方案

When you set an editor in the configuration of Git, make sure to pass the parameter "-w" to force Git to wait your commit message that you would type on your custom editor.

git config --global core.editor "[your editor] -w"

这篇关于由于空提交消息而中止提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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