Good To Know

Really slow git on Windows (aka Windows Antimalware service executable is making it slow)

I was trying to do a git pull from GitHub this morning from the windows CLI (actually, Cygwin xterm) and it was horribly slow.  Most of the time I just CTRL-C out of it and go to PhpStorm and work from their git integration, but I had to do something weird and decided to look into it.  It turns out that the antimalware service executable was eating up most of my time.


For large commits it would take several seconds, if not a minute or two, to execute any operations.

However, the solution for this is quite simple.  There are two solutions, both of which can be used.  The first is to set a directory exclusion.  The second is to set up a process exclusion.

Search Windows for Windows Defender and select the Settings button.


Go to Exclusions


Then either add a directory exclusion


or a process exclusion


I can’t say that I know exactly how Windows defender works but so far it seems like adding the directory exclusion is sufficient to increase performance.  Windows Defender is still running a little hotter in the background, but it’s nowhere near the full CPU time.  I would also guess that approach is a little safer.  Technically someone could use an exploited git checkout evil code into a known location and then execute the contents.  But the likelihood of them knowing where your development directories are is quite low.

1 thought on “Really slow git on Windows (aka Windows Antimalware service executable is making it slow)”

Leave a Reply to Rancher Lara Cancel reply

Your email address will not be published. Required fields are marked *