【问题标题】:Revert Git Editor恢复 Git 编辑器
【发布时间】:2019-05-17 08:59:51
【问题描述】:

我尝试更改 Git 的本机代码编辑器,但没有成功。现在,每当我尝试恢复提交时,都会收到以下错误:

hint: Waiting for your editor to close the file... notepad++.exe -wl1: notepad++.exe: command not found
error: There was a problem with the editor 'notepad++.exe -wl1'.
Please supply the message using either -m or -F option.

我想知道如何重置或删除我所做的尝试修改。

【问题讨论】:

  • 那么您的问题是关于恢复提交(Git 中的一个非常具体的事情,使用git revert 命令),还是关于更新您的配置设置? 如果是后者,请参阅stackoverflow.com/q/6459506/1256452

标签: git text-editor git-revert


【解决方案1】:

从全局和本地配置中删除设置:

git config --global --unset-all core.editor
git config --unset-all core.editor

默认编辑器是vim,它有点难以掌握,所以你最好设置一个不同的、更熟悉的编辑器。见

How do I make Git use the editor of my choice for commits?

https://stackoverflow.com/search?q=%5Bgit%5D+core.editor

【讨论】:

  • 非常感谢!
【解决方案2】:

只需在 ~/.gitconfig (C:\Users\<user>\.gitconfig) 的 [core] 部分下找到并修复 editor 设置即可。

【讨论】:

  • 但是如果我没有尝试更改任何内容,我该如何从 hte 命令行中删除我在那里的条目,并将其恢复为默认值
  • 您可以使用您喜欢的编辑器打开该文件,然后简单地删除这些行。
猜你喜欢
  • 1970-01-01
  • 2022-06-17
  • 2020-09-10
  • 2015-04-24
  • 2012-01-19
  • 2020-04-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多