简体   繁体   English

如何修复 Git bash 无法在 Windows 上工作

[英]How can I fix Git bash not working on Windows

I uninstalled a few apps in control panel, then my git bash stopped working.我在控制面板中卸载了一些应用程序,然后我的 git bash 停止工作。

I think its related but not sure what it might be that made it stop.我认为它是相关的,但不确定是什么让它停止了。 When I run bash outside of vscode i get the following (screenshot)当我在 vscode 之外运行 bash 时,我得到以下信息(截图)

在此处输入图像描述

The only apps I remember uninstalling were Windows SDK tools and Visual Studio Installer.我记得卸载的唯一应用程序是 Windows SDK 工具和 Visual Studio 安装程序。

I tried re-installing git bash but I still get the same error.我尝试重新安装 git bash 但我仍然得到同样的错误。

I get the following error in vs-code terminal我在 vs-code 终端中收到以下错误

      2 [main] bash (12412) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fa
tal error - cygheap base mismatch detected - 0x1368408/0x12C8408.
This problem is probably due to using incompatible versions of the cygwin DLL.
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.
      2 [main] bash 100 dofork: child -1 - forked process 12412 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
      2 [main] bash (8824) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1308408.
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.
1290157 [main] bash 100 dofork: child -1 - forked process 8824 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
      2 [main] bash (14364) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1388408.
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.
3499346 [main] bash 100 dofork: child -1 - forked process 14364 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
      2 [main] bash (7688) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1388408.
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.
4652774 [main] bash 100 dofork: child -1 - forked process 7688 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
      2 [main] bash (2216) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x11D8408.
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.
6724468 [main] bash 100 dofork: child -1 - forked process 2216 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
      2 [main] bash (3380) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x11D8408.
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.
10811431 [main] bash 100 dofork: child -1 - forked process 3380 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
      2 [main] bash (14080) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1308408.
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.
18892759 [main] bash 100 dofork: child -1 - forked process 14080 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: Resource temporarily unavailable
bash-4.4$

copy from https://github.com/mintty/wsltty/issues/6https 复制://github.com/mintty/wsltty/issues/6

Here is the fix.这是修复。

  1. Go to you Windows Defender Security Center settings Go 给你 Windows Defender 安全中心设置
  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" Go 到“程序设置”并点击“添加要自定义的程序”->“选择确切的文件路径”
  5. Navigate to "C:\Program Files\Git\usr\bin\sh.exe" and add it导航到“C:\Program Files\Git\usr\bin\sh.exe”并添加它
  6. Override and turn off the following: Mandatory ASLR Randomize memory allocations (Bottom-up ASLR)覆盖并关闭以下内容:强制 ASLR 随机化 memory 分配(自下而上的 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还要从同一文件夹中添加这些其他二进制文件:expr.exe、uname.exe、grep.exe、rm.exe

Good luck, Gabriel祝你好运,加布里埃尔

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Windows 上从 git bash 运行 PHPUnit? - How can I run PHPUnit from git bash on Windows? 如何使用 git bash 删除 ~$ 文件(在 Windows 上) - How can I remove ~$ files using git bash (on windows) 如何在Windows的Git Bash上使“ man”或“ nano”可用? - How can I make “man” or “nano” available on Git Bash on Windows? 如何在Windows上的Git Bash中使用Pik for Ruby? - How can I use Pik for Ruby in Git Bash on Windows? windows 上的 git bash 存在问题。 我无法访问 git bash for windows 上的文件夹 - problems with git bash on windows. i can't access folders on git bash for windows Windows 上 Git Bash 中的 Bash 扩展变量不起作用? - Bash expand variable in Git Bash on Windows not working? 在Git for windows“git bash”中,如何以Windows路径格式“打印工作目录”,可以使用cmd和Windows资源管理器吗? - In Git for windows “git bash”, how to “print working directory” in Windows path format that is usable by cmd and Windows explorer? 如何在 Windows 中的 git-bash 中执行位于带有空格的文件夹(即“程序文件”)中的命令? - How can I execute commands in git-bash in Windows which are located in a folder with spaces ie “Program Files”? 如何从任何文件夹运行git bash脚本(运行Windows 7) - How can I run git bash scripts from any folder (Running Windows 7) 如何在没有鼠标的情况下在 Windows 7 的 git bash 终端中选择文本? - How can I select text in git bash terminal in Windows 7 without mouse?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM