带有 core.editor 的 git commit 命令等于 atom [英] git commit command with core.editor equals atom

查看:37
本文介绍了带有 core.editor 的 git commit 命令等于 atom的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 atom 编辑器时遇到问题.我通过命令将atom设置为core.editor:

I have a problem with atom editor. I set atom as the core.editor by command:

git config --global core.editor atom

但是当我尝试将更改提交到 git 中的存储库时

But when I try to commit the changes to a repository in git by

git commit

命令,我希望我选择的编辑器会打开并提示提交消息,但在它打开之前 git 抛出错误

command, I expects that the editor of my choice will open and prompt for the commit message but before it opens git throws an error

Aborting commit due to empty commit message.

它打开编辑器后,当我输入提交消息并退出编辑器时,没有发生提交,我知道我可以使用命令

after it it opens the editor and when I enter the commit message and quits the editor no commit occurs, I know I can use command

git commit -m '<message>'

但是我想知道为什么会出现这个错误以及如何解决.

but I want to know why this error occurs and how to solve it.

推荐答案

尝试:

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

原子 --wait 标志等待窗口关闭后再返回.

the atom --wait flag wait for window to be closed before returning.

这篇关于带有 core.editor 的 git commit 命令等于 atom的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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