Msysgit bash is horrendously slow in Windows 7 Msysgit bash is horrendously slow in Windows 7 git git

Msysgit bash is horrendously slow in Windows 7


You can significantly speed up Git on Windows by running three commands to set some config options:

git config --global core.preloadindex truegit config --global core.fscache truegit config --global gc.auto 256

Notes:

  • core.preloadindex does filesystem operations in parallel to hide latency (update: enabled by default in git 2.1)

  • core.fscache fixes UAC issues so you don't need to run Git as administrator (update: enabled by default in Git for Windows 2.8)

  • gc.auto minimizes the number of files in .git/


The solution for slowness on Vista or 7 appears to be running Git Bash using Run as administrator (or disabling UAC for the Git Bash shortcut...or disabling UAC entirely). The difference is night and day and using git on 7 is awesome again.

This appears to be related to a known issue and, as I speculated, XP as a development environment for msysgit is partially responsible.


For me the issue was the use __git_ps1 in the shell prompt - I guess due to slow disk access in msysgit.

Solution was to remove $(__git_ps1) from the PS1=... lines in /etc/profile

quick test if this solution applies: in a git shell, type export PS1='$ 'and check the speed of your operations.