【问题标题】:How to fix git commit with atom text editor如何使用 atom 文本编辑器修复 git commit
【发布时间】:2018-03-01 16:56:06
【问题描述】:

我在使用 atom 文本编辑器提交文件时遇到问题

我在 Git Bash

中使用过

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

但是当提交这样的文件时:

git commit

出现此错误:

hint: Waiting for your editor to close the file... 'C:\Users\SALAH' is not recognized as an internal or external command, operable program or batch file.

Aborting commit due to empty commit message.


但是当使用 sublime text 作为我的文本编辑器时,如下所示: git config --global core.editor "'C:\Program Files\Sublime Text 3\sublime_text.exe' -n -w"

承诺完美运作

这是 atom 或 PATH 的问题...


任何建议我将不胜感激

【问题讨论】:

    标签: git terminal sublimetext3 atom-editor


    【解决方案1】:

    我也遇到了类似的问题,然后我发现我的用户名中两个单词之间有一个空格。

    Git 指向路径,但在用户名 ('C:\Users\SALAH') 中的空格前停止并抛出以下错误 -

    hint: Waiting for your editor to close the file... 'C:\Users\SALAH' is not 
    recognized as an internal or external command,
    operable program or batch file.
    
    Aborting commit due to empty commit message.
    

    解决方案 = 将您的用户名更改为一个单词或不带空格。您可以按照此特定视频更改您的用户名,而无需重新安装 Windows。

    https://www.youtube.com/watch?v=J_rTOA4gXJI

    【讨论】:

      【解决方案2】:

      在行中;

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

      将“atom”替换为 atom 应用程序的直接路径。用单引号将路径括起来。

      例如;

      git config --global core.editor "'C:\Users\name\AppData\Local\atom\app-1.53.0\atom.exe' --wait"
      

      【讨论】:

        【解决方案3】:

        你需要使用atom.exe的真实路径。

        我的命令如下所示:

        $ git config --global core.editor "C:/Users/name/AppData/Local/atom/atom.exe"

        它对我有用。你也可以试试看。

        祝你好运!

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2019-02-11
          • 2020-06-25
          • 2014-05-03
          • 2015-12-17
          • 2020-04-27
          • 2023-04-10
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多