Cygwin/Git error cygheap base mismatch detected Cygwin/Git error cygheap base mismatch detected git git

Cygwin/Git error cygheap base mismatch detected


I had the same problem.

I just restarted my PC and it worked again.

It doesn't help to find reason of problem but at least you can keep on to work.


No Cygwin, no GitHub

I've only started experiencing this lately, and none of the answers above applied to my case - I didn't have Cygwin or GitHub installed.

Instead, in my case a Windows security feature, Address Space Layout Randomization or ASLR created this problem. This is off by default for programs that do not mark themselves compatible.
However, I've enabled ASLR for all programs for additional safety. The downside is that git commands don't work now.

Solution

The solution was to exclude ASLR for git executables. Because there're quite many of them, I had to use PowerShell as administrator:

Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }


EDIT: I found the solution.

TL;DR: Go to the GitHub AppData folder and delete the PortableGit folder, and restart GitHub

  1. Close GitHub
  2. Navigate to the GitHub AppData folder:C:\Users\[username]\AppData\Local\GitHub
  3. Delete the folder that starts with PortableGit and ends in a random string of letters and numbers
  4. Restart GitHub. It will re-extract the dlls and the problem should be fixed!

(Original "answer")I tried a whole bunch of things, and I have no idea what actually worked in the end. I restarted GitHub, restarted my computer, uninstalled and reinstalled GitHub, uninstalled several other programs that I had recently installed but ended up not needing, deleted the GitHub folder in the AppData\Local directory, downloaded and installed cygwin, and possibly some other stuff I'm forgetting.

The last attempt was finding all the cygwin1.dll files in File Explorer and renaming them to cygwin1x.dll and then restarting my computer. After I did that, it worked again.

I'm hazarding a guess here, but I'm going to say that downloading and installing cygwin and then restarting my computer did the trick.