1

My Git Bash shell in Windows 10 is stuck in the following state and no matter what commands I enter, it only returns the "Permission denied" message as shown in the screenshot:

https://i.stack.imgur.com/C29Y3.jpg

Note that this is the screen I get when I open the Git Bash shell, no matter where I open it (even after restarting the system) and no matter what command I enter! This does not happen only in a certain situation, I'm basically stuck at this screen and cannot get Git Bash to return to its normal state, i.e. it's unusable for me as it is. The only command I can enter is "exit", upon which the terminal closes.

For all other commands, this is what I receive: 198671088 [main] bash 11048 fork: child -1 - CreateProcessW failed for 'C:\Program Files\Git\usr\bin\bash.exe', errno 13 bash: fork: Permission denied

How I got here: I entered "git status" and was then unable to return from that screen since no input was accepted (Cmd + C, Cmd + Q, Q etc. did not work), so I bashed my keyboard randomly until Git attempted to fork, however it failed with the message in the screenshot being returned (btw, I'm obviously a beginner).

What I've tried: restarting the system, reinstalling Git, various command inputs, running Git Bash as admin, checking PATH variable, trying killing the process in Task Manager (there is none when Git Bash is closed) etc.

Does someone have a clue as to what I can do? Would greatly appreciate it!

Dario F
  • 11
  • 1
  • 3
  • Did you upgrade your OS? Which Operating System you are using? – Pavan_Obj May 09 '19 at 20:30
  • I have Windows 10 which is updated regularly. The issue did not appear after an update, but after the git status / git log commands I entered – Dario F May 11 '19 at 10:35

1 Answers1

0

Try first the same bash command from a CMD with a simplified PATH.
And use the latest version of the Git for Windows.

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

See if the issue persists: if not, that would point out a PATH issue.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for the attempt, but the issue unfortunately persists. One important note - I am able to enter git commands in cmd and so far it seems to be working. However, as soon as I open the Git bash, the old issue remains. I've already uninstalled Git for Windows, deleted the Git folder in Program Files, and reinstalled the latest version, however the issue stays the same. Any ideas on what else it could be? – Dario F May 11 '19 at 10:33
  • @DarioF" as soon as I open the Git bash": but, how do you open git bash? Does the issue persists if you "open" bash by simply typing `bash --login -i` in the CMD where the simplified PATH has been set? – VonC May 11 '19 at 21:31
  • I open it via "Git Bash Here" via right click context menu. I've also tried opening git-bash.exe in the \Git\ folder, the "bash.exe" in \Git\bin folder and "bash.exe" in \Git\usr\bin folders. I've used `bash --login -i` in cmd in the Git folders (bin and usr\bin) as you suggested. I did all of the above via "execute as administrator" and tried using PowerShell, too - to no avail. A very curious note - when I try to open bash.exe ..\Git\usr\bin by clicking on it, there is an error "application could not be started (0x0000142)"! I can access the bash via cmd in that folder, however. – Dario F May 11 '19 at 22:38
  • @DarioF Don't do context menu: the test I propose relies only on the portable version of the latest Git, uncompressed anywhere you want: no context menu with that one. – VonC May 11 '19 at 22:47