【问题标题】:git commit command with core.editor equals atom带有 core.editor 的 git commit 命令等于 atom
【发布时间】:2016-06-08 15:11:26
【问题描述】:

我对 atom 编辑器有疑问。我通过命令将 atom 设置为 core.editor:

git config --global core.editor atom

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

git commit

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

Aborting commit due to empty commit message.

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

git commit -m '<message>'

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

【问题讨论】:

    标签: git atom-editor


    【解决方案1】:

    尝试:

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

    atom --wait 标志等待窗口关闭后再返回。

    【讨论】:

    • 在带有 zsh 的 MacOS BigSur 上对我不起作用!!
    • @iCantC 这对我有用:git config --global core.editor "/Applications/Atom.app/Contents/Resources/app/atom.sh -n -w"
    猜你喜欢
    • 2021-11-05
    • 1970-01-01
    • 2017-06-12
    • 1970-01-01
    • 2011-03-17
    • 1970-01-01
    • 2015-04-01
    • 2016-01-24
    相关资源
    最近更新 更多