I am using git bash on Windows 7 which is extremely slow. The user profile is on a network drive, so I changed the start to start on the c: drive. I also removed the PS1 prompt and I just use $
.
I also have done:
$ git config --global core.preloadindex true
$ git config --global core.fscache true
Some things have speed up, but the git commands themselves are extremely slow. Any idea why? Here is a strace.
$ GIT_TRACE=1 git stash
09:27:27.099458 git.c:594 trace: exec: 'git-stash'
09:27:27.099458 run-command.c:369 trace: run_command: 'git-stash'
09:27:28.862258 git.c:594 trace: exec: 'git-sh-i18n--envsubst' '--variables' 'usage: $dashless $USAGE'
09:27:28.862258 run-command.c:369 trace: run_command: 'git-sh-i18n--envsubst' '--variables' 'usage: $dashless $USAGE'
09:27:29.096258 git.c:594 trace: exec: 'git-sh-i18n--envsubst' 'usage: $dashless $USAGE'
09:27:29.096258 run-command.c:369 trace: run_command: 'git-sh-i18n--envsubst' 'usage: $dashless $USAGE'
09:27:29.877258 git.c:369 trace: built-in: git 'rev-parse' '--git-dir'
09:27:30.267258 git.c:369 trace: built-in: git 'rev-parse' '--git-path' 'objects'
09:27:30.766458 git.c:369 trace: built-in: git 'rev-parse' '--show-toplevel'
09:27:30.984858 git.c:369 trace: built-in: git 'rev-parse' '--git-path' 'index'
09:27:31.281258 git.c:369 trace: built-in: git 'config' '--get-colorbool' 'color.interactive'
09:27:31.608858 git.c:369 trace: built-in: git 'config' '--get-color' 'color.interactive.help' 'red bold'
09:27:31.967658 git.c:369 trace: built-in: git 'config' '--get-color' '' 'reset'
09:27:32.375258 git.c:369 trace: built-in: git 'ls-files' '--error-unmatch' '--'
09:27:32.702858 git.c:369 trace: built-in: git 'update-index' '-q' '--refresh'
09:27:33.048058 git.c:369 trace: built-in: git 'diff-index' '--quiet' '--cached' 'HEAD' '--ignore-submodules' '--'
09:27:33.392258 git.c:369 trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules' '--'
No local changes to save
On Cygwin, real time is only 3 seconds. Here on git bash, 9 seconds.
$ time git stash
No local changes to save
real 0m9.172s
user 0m0.015s
sys 0m0.108s
$
Here is Cygwins trace to compare against:
$ GIT_TRACE=1 git stash
13:02:51.567376 git.c:595 trace: exec: 'git-stash'
13:02:51.567376 run-command.c:369 trace: run_command: 'git-stash'
13:02:52.740271 git.c:595 trace: exec: 'git-sh-i18n--envsubst' '--variables' 'usage: $dashless $USAGE'
13:02:52.740271 run-command.c:369 trace: run_command: 'git-sh-i18n--envsubst' '--variables' 'usage: $dashless $USAGE'
13:02:52.990489 git.c:595 trace: exec: 'git-sh-i18n--envsubst' 'usage: $dashless $USAGE'
13:02:52.990489 run-command.c:369 trace: run_command: 'git-sh-i18n--envsubst' 'usage: $dashless $USAGE'
13:02:53.459647 git.c:371 trace: built-in: git 'rev-parse' '--git-dir'
13:02:53.694226 git.c:371 trace: built-in: git 'rev-parse' '--git-path' 'objects'
13:02:53.975720 git.c:371 trace: built-in: git 'rev-parse' '--show-toplevel'
13:02:54.085191 git.c:371 trace: built-in: git 'rev-parse' '--git-path' 'index'
13:02:54.194661 git.c:371 trace: built-in: git 'config' '--get-colorbool' 'color.interactive'
13:02:54.304131 git.c:371 trace: built-in: git 'config' '--get-color' 'color.interactive.help' 'red bold'
13:02:54.413601 git.c:371 trace: built-in: git 'config' '--get-color' '' 'reset'
13:02:54.523071 git.c:371 trace: built-in: git 'update-index' '-q' '--refresh'
13:02:54.775294 git.c:371 trace: built-in: git 'diff-index' '--quiet' '--cached' 'HEAD' '--ignore-submodules' '--'
13:02:54.900403 git.c:371 trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
No local changes to save