Git Bash 无法初始化
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38494951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git Bash cannot be initialized
提问by J John
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?
当我使用 git bash 时,它说“无法派生子进程:资源暂时不可用。可能需要 DLL 重新定位。请参阅 'rebaseall --help'。” 我该如何解决这个问题?
When I use tortoiseGit to stash I got some message like this
当我使用 tortoiseGit 存储时,我收到了一些这样的消息
> 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
0 [main] sh (8240) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x1200400.
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.
1036670 [main] sh 13140 fork: child -1 - forked process 8240 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
2 [main] sh (10380) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x12B0400.
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.
3174011 [main] sh 10992 fork: child -1 - forked process 10380 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
2 [main] sh (9232) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x1330400.
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.
4240906 [main] sh 10992 fork: child -1 - forked process 9232 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
0 [main] sh (4164) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x13C0400.
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.
6274008 [main] sh 10992 fork: child -1 - forked process 4164 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
2 [main] sh (6172) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x1410400.
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.
10341657 [main] sh 10992 fork: child -1 - forked process 6172 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
2 [main] sh (4008) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x13B0400.
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.
18409517 [main] sh 10992 fork: child -1 - forked process 4008 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
D:\Program Files (x86)\Git\mingw32/libexec/git-core\git-stash: fork: Resource temporarily unavailable
0 [main] sh (11752) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x1350400.
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.
18455570 [main] sh 13140 fork: child -1 - forked process 11752 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
2 [main] sh (7824) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x1350400.
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.
19501977 [main] sh 13140 fork: child -1 - forked process 7824 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
2 [main] sh (3708) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x13D0400.
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.
21578926 [main] sh 13140 fork: child -1 - forked process 3708 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
2 [main] sh (3908) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x11F0400.
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.
25643366 [main] sh 13140 fork: child -1 - forked process 3908 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
2 [main] sh (8904) D:\Program Files (x86)\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1360400/0x13F0400.
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.
33708123 [main] sh 13140 fork: child -1 - forked process 8904 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
D:\Program Files (x86)\Git\mingw32/libexec/git-core\git-stash: fork: Resource temporarily unavailable
采纳答案by VonC
Try instead the portable version of Git for Windows 2.9.2:
尝试使用适用于 Windows 2.9.2的便携版Git:
- unzip
PortableGit-2.9.2-64-bit.7z.exe
anywhere you want (likeD:\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
- 解压缩到
PortableGit-2.9.2-64-bit.7z.exe
任何你想要的地方(比如D:\git\git2.9.2
), - 从您的 PATH
D:\Program Files (x86)\Git
相关路径中删除 - 添加到您的 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:
然后,从 CMD 会话:
- cd to a git repo
- type
bash -i --login
and check the bash works properly
- cd 到 git 仓库
- 输入
bash -i --login
并检查 bash 是否正常工作
回答by Azhar Mohamed
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.
一天早上我遇到了同样的问题。我试图卸载 Git 只是为了查看它是否已损坏,它指示我关闭一些类似于sh.exe
任务管理器中的进程。在我杀死他们之后,我能够成功打开 Git bash。
Cheers!
干杯!
回答by Gabriel Bercea
Here is the fix.
这是修复。
- Go to you Windows Defender Security Center settings
- Click on App & Browser Control
- At the bottom click on the "Exploit Protection Settings" link
- Go to "Program Settings" and click on the "Add program to customize" -> "Choose exact file path"
- Navigate to "C:\Program Files\Git\usr\bin\sh.exe" and add it
- Override and turn off the following: Mandatory ASLR, Randomize memory allocations (Bottom-up ASLR)
- Click "Apply" and now everything should work fine.
- 转到您的 Windows Defender 安全中心设置
- 单击应用程序和浏览器控制
- 在底部单击“漏洞利用保护设置”链接
- 转到“程序设置”并单击“添加要自定义的程序”->“选择确切的文件路径”
- 导航到“C:\Program Files\Git\usr\bin\sh.exe”并添加它
- 覆盖并关闭以下内容:强制 ASLR、随机化内存分配(自下而上 ASLR)
- 单击“应用”,现在一切正常。
Also add these other binaries from the same folder: expr.exe, uname.exe, grep.exe, rm.exe
还要从同一文件夹中添加这些其他二进制文件:expr.exe、uname.exe、grep.exe、rm.exe
Good luck,
Gabriel
祝你好运,
加布里埃尔