我曾经有8个git bash终端同时运行。

目前我只有2个。

我以前没有见过这个错误,我不知道是什么原因造成的。

任何帮助都将不胜感激!

图片附件:


当前回答

我试图杀死我所有的git终端在任务管理器解决了这个问题。 这对我也适用。 祝你好运。

其他回答

对于windows,在任务管理器中杀死sh.exe。

在我的例子中,问题是[git_install_dir]/etc/nsswitch.conf文件

我之前遵循了这里给出的说明: https://cygwin.com/faq.html faq.using.startup-slow。 但这反而导致了“无法分叉”错误。 我错误的nsswitch.conf文件是:

passwd: files
group: files

所以我恢复了文件,问题解决了。现在我的[git_install_dir]/etc/nsswitch.conf是:

passwd: files db
group: files # db
db_enum: cache builtin
db_home: env windows cygwin desc
db_shell: env windows # cygwin desc
db_gecos: env # cygwin desc

打开你的任务管理器,搜索“sh”进程并杀死它们。 祝你好运

打开任务管理器,找到bash.exe进程并杀死它。对我有帮助。

在我的例子中,我在Git Bash中运行jupyter-notebook,并在没有关闭notebook的情况下关闭了终端。当我关闭所有运行的git bash终端并试图打开新终端时,这给了我一个错误:

Error: Could not fork child process: There are no available terminals (-1).

解决方案

taskkill /F /IM jupyter-notebook.exe

在那之后,我能够在git bash终端中运行命令。