Git bash Error: Could not fork child process: There are no available terminals (-1)
Found a similar issue and solution in google groups
I opened a windows command prompt and ran the command
$ tasklist
It looks as though the ssh connections I had made in my git bash shells weren't being closed when those windows were closed and were hanging the available git bash shell windows.
This may be a dangerous solution but from the windows command prompt I ran
$ taskkill /F /IM ssh.exe
Everything appears to be working again after this. It may not have directly been an issue of orphan processes, but this worked for at least for me.
Additional note: you can also kill other processes, for example like:
$ taskkill /F /IM vim.exe
In my case, it was related with the use of VS code. Previously I have opened VS code using a git bash terminal and executing
code .
then closing the terminal.
The problem is solved by closing all the VS code windows opened.
When you have any editor or IDE configure to open a terminal as git bash, then when the IDE/IDE is running, the git bash will spin up bash from "C:\Windows\System32\bash.exe" and any other attempt to open bash from a separate window is likely to crash.
The best solution is to kill the IDE/Editor bash and open from a new window or continue from the IDE/Editor command.
I see the problem on windows in git bash when I kill my git bash console without using exit. I found killing ssh-agent.exe task from windows task manager to fix the problem.