Git Bash is extremely slow on Windows 7 x64
My Windows home directory is on the network, and I suspected that Git Bash commands were looking there first. Sure enough, when I looked at $PATH
, it listed /h/bin
first, where /h
is a share on a Windows file server, even though /h/bin
doesn't exist.
I edited /etc/profile
and commented out the export command that puts it first in $PATH
:
#export PATH="$HOME/bin:$PATH"
This made my commands run much faster, probably because Git Bash is no longer looking across the network for the executables. My /etc/profile
was c:\Program Files (x86)\Git\etc\profile
.
You can significantly speed up Git on Windows by running three commands to set some config options:
git config --global core.preloadindex true
git config --global core.fscache true
git 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/
Do you have Git information showing in your Bash prompt? If so, maybe you're inadvertently doing way too much work on every command. To test this theory try the following temporary change in Bash:
export PS1='$'