If you encounter the following error when pulling a repository in SourceTree:
VirtualAlloc pointer is null, Win32 error 487
it is due to to the Cygwin system failing to allocate a 5 MB large chunk of memory for its heap at the fixed address 0x68570000, while only a hole 2.5 MB large was apparently available there (see the whole thread on SO). Unfortunately, attempts to rebase MSYS or other tricks are not working, requiring a full reboot of the PC to properly complete pulls.
To resolve this problem once and for all, upgrade the Git used by SourceTree from version 1.x to version 2: click on Tools | Options, select the Git tab and check the version, in this case it is “System Git version 1.8.4”.
As we are still using Git 1.x, click on Update Embedded Git and confirm that we want to download the embedded version:
SourceTree will then download the new version of Git (notice that the current version at the time of writing is 2.10.2)
And that’s it! The embedded version of Git is now updated to 2.x, we switch to the embedded Git by clicking on the “Use Embedded Git” button, and the error is gone for good