如何修复关闭编辑器窗口后的git提交错误?

5
我最近开始学习Git和GitHub,需要帮助解决以下问题:
每当我关闭文本编辑器时,它会出现错误而不是添加提交。请参考下图:https://istack.dev59.com/wIqw8.webp

为什么要使用 python 标签? - Ofer Sadan
2个回答

3

您能检查一下您的编辑器配置吗?

git config --global core.editor

请查看这个答案,并使用git config --global --edit命令编辑您的配置文件,添加引号:

editor = 'atom -w'

还要检查atom / atom问题16805

Especially since Atom 1.24.0 it happens quite regularly that Atom freezes after starting.
The freeze is not complete but rather the menu partially works but it is not possible to edit any already open files or to open a new file.

When starting Atom with the --foreground option and it does not completely freeze the following message is shown:

Attempting to call a function in a renderer window that has been closed or released.
Function provided here: Object.<anonymous> (C:\Users\doberkofler.LBITS\AppData\Local\atom\app-1.24.0\resources\app.asar\node_modules\github\lib\worker.js:71:22   
Remote event names: destroyed, crashed

0

Git 要求您为提交添加一条消息。当您输入 git commit 时,它会尝试打开您配置的编辑器以输入提交消息。由于您的编辑器崩溃,无法完成提交。(请参见其他答案以了解如何编辑首选项)。

对您来说最快的解决方法是直接在控制台中使用以下命令为提交提供提交消息:

git commit -m "在此处插入您的提交消息"

这将跳过编辑器步骤,直接附加消息。

由于您是 Git 的新手并且似乎渴望学习,我可以推荐 以下文章 关于编写良好提交消息的内容?这确实帮助了我很多。

摘自该文章:

Git提交信息的七个规则 请记住:这些都已经说过了。
  1. 用空行将主题与正文分开
  2. 将主题行限制在50个字符以内
  3. 大写主题行
  4. 不要在主题行末尾加句号
  5. 使用祈使语气来表达主题
  6. 将正文换行,每行限制在72个字符以内
  7. 使用正文解释“为什么”和“做什么”,而不是“如何做”

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接