I have checked the available memory and looks like there is plenty of it:
vagrant@homestead:~$ free -m
total used free shared buffers cached
Mem: 2001 869 1131 21 22 252
-/+ buffers/cache: 594 1406
Swap: 767 0 767
Any suggestions?
I found the issue. It was being caused by git trying to create a config file in the directory that a /config directory already existed.
I have now removed the /config directory and was able to run
git init --bare
However, this is a problem with all of my apps as they all contain /config directories. Does anyone know a workaround?