我不小心将 git 编辑器设置为 Atom,如何将其恢复为 Git Bash?
I accidentally set my git editor to Atom, how can I revert it to Git Bash?
所以我遇到了 "Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch" 的错误,我在 thread.
中找到了解决方法
但是其中一个答案说,您的文本编辑器是问题所在,因此请将其更改为 Atom,并且在不知道如何在 Atom 中使用编辑器的情况下,我通过以下代码将 git 编辑器更改为 Atom:
git config --global core.editor "atom --wait"
我正在使用 Git Bash,我想 return 将其作为我的核心编辑器,但我似乎找不到如何做的方法那。
P.S。我已经进入 Git 几天了,所以请原谅我犯的任何基本错误。
试试这个:
git config --global --unset-all core.editor
如果你想通过git将editor-setting设置为GitBash命令行,那么你可以改为nano-编辑器如下所示:
git config --global core.editor "nano"
因此,如果您在添加文件后输入 git commit -a
,它会在您写入的终端上打开一个文件(例如 Git Bash) git-命令,你可以在那里写下你的提交消息。
编辑:
根据 的回答,您重置 core.editor
的设置,您将拥有与输入 ... core.editor "atom --wait"
之前相同的设置。
所以我遇到了 "Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch" 的错误,我在 thread.
中找到了解决方法但是其中一个答案说,您的文本编辑器是问题所在,因此请将其更改为 Atom,并且在不知道如何在 Atom 中使用编辑器的情况下,我通过以下代码将 git 编辑器更改为 Atom:
git config --global core.editor "atom --wait"
我正在使用 Git Bash,我想 return 将其作为我的核心编辑器,但我似乎找不到如何做的方法那。
P.S。我已经进入 Git 几天了,所以请原谅我犯的任何基本错误。
试试这个:
git config --global --unset-all core.editor
如果你想通过git将editor-setting设置为GitBash命令行,那么你可以改为nano-编辑器如下所示:
git config --global core.editor "nano"
因此,如果您在添加文件后输入 git commit -a
,它会在您写入的终端上打开一个文件(例如 Git Bash) git-命令,你可以在那里写下你的提交消息。
编辑:
根据 core.editor
的设置,您将拥有与输入 ... core.editor "atom --wait"
之前相同的设置。