Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git status takes too long on a shared folder on virtualbox

Tags:

git

virtualbox

I have a shared folder from my host machine -> guest machine on my virtualbox (Mac OS X host, RedHat guest). The shared folder was created on the host and I did things like git checkout etc. on the guest. The problem is that it takes too long to run commands like git status and others on the guest. Is it a known problem or is there a workaround to solve this?

(git status works fine on a non-shared folder on both host or guest).

like image 822
Rajat Avatar asked Sep 15 '12 01:09

Rajat


2 Answers

Try entering git prune && git gc to perform a cleanup of unreachable objects and a garbage collect. You can also do git repack -Adf to try repacking everything and see if that makes any change. git status is speed limited by walking the working tree and calling stat() on everything. If that call is slow (network drive or something about the virtualization) then the status command will perform poorly.

git fsck and git count-objects are a couple more commands to use. If there a lots (>200) of objects things can start to be slower.

like image 121
patthoyts Avatar answered Sep 19 '22 23:09

patthoyts


Then clone from that repo to a better filesystem, work there, push your changes back.

like image 44
jthill Avatar answered Sep 17 '22 23:09

jthill