英文:
Git "cannot spawn interactive-rebase-tool" and "unable to start editor 'interactive-rebase-tool'" when running "rebase -i"
问题
在运行 "git rebase -i" 命令时,在 Git Bash 中没有弹出文本编辑器窗口,并产生以下错误消息:
提示:等待编辑器关闭文件... 错误:无法生成互动式重新基础工具:没有此文件或目录
错误:无法启动编辑器 'interactive-rebase-tool'
我正在使用默认的编辑器 Vim。至今为止,提交工作正常。Git 版本是 2.40.0.windows.1,Windows 操作系统版本是 10.0.19045。
我尝试过在我的硬盘驱动器上搜索 "interactive-rebase-tool",以及在互联网上搜索相关信息,但都没有成功。重新启动和重新安装 Git 也没有帮助。
英文:
When running "git rebase -i" in git bash, no text editor window pops up and the following messages are produced
hint: Waiting for your editor to close the file... error: cannot spawn
interactive-rebase-tool: No such file or directory
error: unable to start editor 'interactive-rebase-tool'
I'm using the default editor, Vim. Committing works fine so far.
The Git version is 2.40.0.windows.1 and the Windows OS version is 10.0.19045.
I have tried searching for "interactive-rebase-tool", both for files on my hard drive and for information on the Internet, but to no avail. Rebooting and reinstalling Git didn't help, either.
答案1
得分: 1
你检查了你的配置,结果发现你有以下设置:
$ git config --list | grep interactive-rebase-tool
sequence.editor=interactive-rebase-tool
这是导致问题的根本原因:有了这个设置,当你运行 git rebase -i
时,git
将尝试启动一个名为 interactive-rebase-tool
的程序,而显然你没有这个程序。
移除这个设置。
查看这个特定设置来自哪里:
git config --show-scope sequence.editor
范围可能会显示"local"或"global"。要删除这个设置:
# 本地:
git config --unset sequence.editor
# 全局:
git config --global --unset sequence.editor
(你可以查看git help config
以获取有关git config
的详细文档。)
英文:
You checked your configuration, and it turns out you have the following setting:
$ git config --list | grep interactive-rebase-tool
sequence.editor=interactive-rebase-tool
This is the root cause of your issues: with this setting, git
will try to launch a program named interactive-rebase-tool
when you run git rebase -i
-- and obviously you don't have one.
Remove this setting.
Check where this specific setting comes from:
git config --show-scope sequence.editor
The scope will probably say "local" or "global". To remove this setting :
# local:
git config --unset sequence.editor
# global:
git config --global --unset sequence.editor
(you can have a look at git help config
for extensive documentation on git config
)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论