Git Bash cannot be initialized

2

enter image description here

When i use git bash it says"Failed to fork child process: Resource temporarily unavailable.DLL rebasing may be required. See 'rebaseall --help'." How can I fix this problem?

When I use tortoiseGit to stash I got some message like this

> git.exe stash save -- "12"

0 [main] sh (7224) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x12F0400.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
0 [main] sh 13140 fork: child -1 - forked process 7224 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
D:\Program Files (x86)\Git\mingw32/libexec/git-core\git-stash: fork: retry: No child processes    
git
bash
dll
asked on Stack Overflow Jul 21, 2016 by J John • edited Apr 21, 2021 by Xbox One

4 Answers

21

I had faced the same issue one morning. I tried to uninstall the Git just to see if it was corrupted and it pointed me to shut down few processes that go like sh.exe in the Task manager. After I killed them, I was able to open the Git bash successfully.

Cheers!

answered on Stack Overflow Jan 19, 2017 by Azhar Mohamed • edited May 10, 2017 by Azhar Mohamed
5

Here is the fix.

  1. Go to you Windows Defender Security Center settings
  2. Click on App & Browser Control
  3. At the bottom click on the "Exploit Protection Settings" link
  4. Go to "Program Settings" and click on the "Add program to customize" -> "Choose exact file path"
  5. Add "C:\Program Files\Git\usr\bin\sh.exe" and "C:\Program Files\Git\usr\bin\bash.exe"
  6. Override and turn off the following: Mandatory ASLR, Randomize memory allocations (Bottom-up ASLR)
  7. Click "Apply" and now everything should work fine.

Also add these other binaries from the same folder: expr.exe, uname.exe, grep.exe, rm.exe

Good luck,
Gabriel

answered on Stack Overflow Jan 29, 2018 by Gabriel Bercea • edited Sep 24, 2020 by Serg
1

Try instead the portable version of Git for Windows 2.9.2:

  • unzip PortableGit-2.9.2-64-bit.7z.exe anywhere you want (like D:\git\git2.9.2),
  • remove from your PATH D:\Program Files (x86)\Git related paths
  • add to your PATH D:\git\git2.9.2;D:\git\git2.9.2\bin;D:\git\git2.9.2\cmd;D:\git\git2.9.2\usr\bin

Then, from a CMD session:

  • cd to a git repo
  • type bash -i --login and check the bash works properly
answered on Stack Overflow Jul 21, 2016 by VonC • edited Sep 16, 2019 by Mercury
0

In my case since git bash was working before restarting my machine fix the issue.

Try by restarting your machine first, Hopefully it will fix it.

answered on Stack Overflow Feb 10, 2021 by yibela

User contributions licensed under CC BY-SA 3.0