使用 atom 作为 git 编辑器无法等待提交消息,为什么? [英] Using atom as a git editor fails to wait for commit message, why?

查看:33
本文介绍了使用 atom 作为 git 编辑器无法等待提交消息,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过以下方式配置了我的 git 编辑器:

I have configured my git editor both by:

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

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

基于 StackOverflow 中的一些帖子.

based on some posts in StackOverflow.

我的 .gitconfig 文件有一行:

And my .gitconfig file has oneline like:

editor = atom -w

或:

editor = atom --wait

但是,当我尝试使用 git commit 时,由于提交消息为空,git 中止了提交.在那之后,Atom 在那之后推出.如果我输入了提交信息,保存并退出.bash 中的消息是:

However, when I tried to use git commit, the git aborted commit due to empty commit message. After that, Atom launched after that. If I typed in commit message, save and quit. The message in bash is:

 Attempting to call a function in a renderer window that has been closed or released. Function provided here: Object. Remote event names: destroyed, crashed

有人可以帮我吗?非常感谢.

Could anyone help me? Thanks very much in advance.

推荐答案

我没有安装 atom,但我对 VS Code 做了类似的事情.您是否尝试将命令 开关放在引号内?

I don't have atom installed, but I did a similar thing for VS Code. Have you tried putting the command and the switch together inside quotes?

editor = 'atom -w'

我一直在使用 Bash EDITOR shell 变量来做这件事,因为我的默认编辑器会根据我当时使用的操作系统而改变,无论我是否使用 SSH;所以在项目的 Git 配置中设置它对我来说不是一个解决方案.但它可能适合你.

I've been doing that with the Bash EDITOR shell variable, since my default editor changes depending which OS I'm on at the time, whether I'm using SSH or not; so setting it inside the Git config for a project is not a solution for me. But it may be for you.

所以请尝试一下,然后告诉我们会发生什么.

So please try that and tell us what happens.

这篇关于使用 atom 作为 git 编辑器无法等待提交消息,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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