【问题标题】:Aborting commit due to empty commit message when using git commit although I used -wait and -w [duplicate]尽管我使用了 -wait 和 -w [重复],但在使用 git commit 时由于提交消息为空而中止提交
【发布时间】:2020-11-15 07:18:08
【问题描述】:

因此,我正在参加有关 Git 版本控制的 udacity 课程。我的问题是,当我编辑文件并尝试使用 Git 提交时,编辑器(原子)将打开,但终端中的消息将是“由于提交消息为空而中止提交” 我尝试在配置行中添加“w”、“wait”和“-n -w”,甚至添加了 atom 的路径,但它不起作用。另外,我删除了 (.gitconfig) 中的所有重复行,但没有运气。

如何解决这个问题?

【问题讨论】:

  • 您可以将git config -l 的输出作为代码块发布吗?
  • GitHub docs 说要使用git config --global core.editor "atom --wait"。请注意,它是--wait,而不仅仅是wait。你试过了吗?

标签: git controls version atom-editor commit


【解决方案1】:

如果 Atom 编辑器打开,则 atom 的路径不是问题,因为找到了命令。

相反,程序的参数必须不正确,因为在您完成文件编辑之前命令会立即返回。对于 Atom 编辑器,您需要使用 --wait 让命令等到您完成编辑文件。 GitHub 有一个example config value 用于 Atom 的 core.editor:

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

【讨论】:

  • 我试过了,没用
猜你喜欢
  • 1970-01-01
  • 2022-10-15
  • 1970-01-01
  • 2019-05-17
  • 2019-02-03
  • 1970-01-01
  • 1970-01-01
  • 2018-08-23
  • 1970-01-01
相关资源
最近更新 更多