1

I saw this link Git/Bash is extremely slow in Windows 7 x64 and I followed his advice but nothing works for me.

I uninstalled, rebooted and reinstalled Git and Git Bash works very slow.

I changed the variables:

$ Git config true --global core.preloadindex
$ Git config true --global core.fscache
$ Git config --global gc.auto 256

When you start Git Bash takes more than 5 seconds and commands like ls or pwd take 3 or 4 seconds.

I type set -x in the file /etc/profile and this is the output when Git Bash init:

+ MSYS2_PATH=/usr/local/bin:/usr/bin:/bin
+ MANPATH=/usr/local/man:/usr/share/man:/usr/man:/share/man:
+ INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info:
+ MINGW_MOUNT_POINT=
+ '[' -n MINGW32 ']'
+ case "$MSYSTEM" in
+ MINGW_MOUNT_POINT=/mingw32
+ PATH='/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/AlbertoGonzalez/bin:/c/windows/system32/WindowsPowerShell/v1.0:/c/Program Files (x86)/OpenSSH/bin:/c/Program Files (x86)/SSH Communications Security/SSH Secure Shell'
+ PKG_CONFIG_PATH=/mingw32/lib/pkgconfig:/mingw32/share/pkgconfig
+ ACLOCAL_PATH=/mingw32/share/aclocal:/usr/share/aclocal
+ MANPATH=/mingw32/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man:
+ MAYBE_FIRST_START=false
+ SYSCONFDIR=/etc
+ ORIGINAL_TMP=/tmp
+ ORIGINAL_TEMP=/tmp
+ case "$TMP" in
+ case "$TEMP" in
+ test -d ''
+ test '!' -d /tmp
+ TMPDIR=/tmp
+ export TMPDIR
+ p='/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device'
+ '[' -e '/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' ']'
+ read -r PRINTER
+ PRINTER='\\E2SRV002\KONICA MINOLTA 423 Blanco y Negro'
+ unset p
++ export LC_COLLATE=C
++ LC_COLLATE=C
++ echo '/etc/post-install/*.post'
+ for postinst in '$(export LC_COLLATE=C; echo /etc/post-install/*.post)'
+ '[' -e '/etc/post-install/*.post' ']'
+ '[' '!' 'x4.3.42(5)-release' = x ']'
++ /usr/bin/hostname
+ HOSTNAME=ALBERTOGONZALEZ
+ profile_d sh
+ local file=
++ export LC_COLLATE=C
++ LC_COLLATE=C
++ echo /etc/profile.d/aliases.sh /etc/profile.d/bash_profile.sh /etc/profile.d/env.sh /etc/profile.d/git-prompt.sh /etc/profile.d/lang.sh /etc/profile.d/perlbin.sh
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/aliases.sh ']'
+ . /etc/profile.d/aliases.sh
++ alias 'ls=ls -F --color=auto --show-control-chars'
++ alias 'll=ls -l'
++ case "$TERM" in
++ for name in node ipython php php5 psql python2.7
++ alias 'node=winpty node.exe'
++ for name in node ipython php php5 psql python2.7
++ alias 'ipython=winpty ipython.exe'
++ for name in node ipython php php5 psql python2.7
++ alias 'php=winpty php.exe'
++ for name in node ipython php php5 psql python2.7
++ alias 'php5=winpty php5.exe'
++ for name in node ipython php php5 psql python2.7
++ alias 'psql=winpty psql.exe'
++ for name in node ipython php php5 psql python2.7
++ alias 'python2.7=winpty python2.7.exe'
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/bash_profile.sh ']'
+ . /etc/profile.d/bash_profile.sh
++ '[' -e /c/Users/AlbertoGonzalez/.bashrc -a '!' -e /c/Users/AlbertoGonzalez/.bash_profile -a '!' -e /c/Users/AlbertoGonzalez/.bash_login -a '!' -e /c/Users/AlbertoGonzalez/.profile ']'
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/env.sh ']'
+ . /etc/profile.d/env.sh
++ export 'PATH=/c/Users/AlbertoGonzalez/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/AlbertoGonzalez/bin:/c/windows/system32/WindowsPowerShell/v1.0:/c/Program Files (x86)/OpenSSH/bin:/c/Program Files (x86)/SSH Communications Security/SSH Secure Shell'
++ PATH='/c/Users/AlbertoGonzalez/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/AlbertoGonzalez/bin:/c/windows/system32/WindowsPowerShell/v1.0:/c/Program Files (x86)/OpenSSH/bin:/c/Program Files (x86)/SSH Communications Security/SSH Secure Shell'
++ test -n ''
++ case "$MSYSTEM" in
++ export DISPLAY=needs-to-be-defined
++ DISPLAY=needs-to-be-defined
++ export SSH_ASKPASS=/mingw32/libexec/git-core/git-gui--askpass
++ SSH_ASKPASS=/mingw32/libexec/git-core/git-gui--askpass
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/git-prompt.sh ']'
+ . /etc/profile.d/git-prompt.sh
++ test -f /etc/profile.d/git-sdk.sh
++ TITLEPREFIX=MINGW32
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h '
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM '
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w'
++ test -z ''
+++ git --exec-path
++ GIT_EXEC_PATH='C:\Program Files (x86)\Git\mingw32/libexec/git-core'
++ COMPLETION_PATH='C:\Program Files (x86)\Git\mingw32'
++ COMPLETION_PATH='C:\Program Files (x86)\Git\mingw32'
++ COMPLETION_PATH='C:\Program Files (x86)\Git\mingw32/share/git/completion'
++ test -f 'C:\Program Files (x86)\Git\mingw32/share/git/completion/git-prompt.sh'
++ . 'C:\Program Files (x86)\Git\mingw32/share/git/completion/git-completion.bash'
+++ case "$COMP_WORDBREAKS" in
+++ : great
+++ type _get_comp_words_by_ref
+++ __git_merge_strategies=
+++ __git_all_commands=
+++ __git_porcelain_commands=
+++ __git_whitespacelist='nowarn warn error error-all fix'
+++ __git_diff_algorithms='myers minimal patience histogram'
+++ __git_diff_common_options='--stat --numstat --shortstat --summary
                        --patch-with-stat --name-only --name-status --color
                        --no-color --color-words --no-renames --check
                        --full-index --binary --abbrev --diff-filter=
                        --find-copies-harder
                        --text --ignore-space-at-eol --ignore-space-change
                        --ignore-all-space --ignore-blank-lines --exit-code
                        --quiet --ext-diff --no-ext-diff
                        --no-prefix --src-prefix= --dst-prefix=
                        --inter-hunk-context=
                        --patience --histogram --minimal
                        --raw --word-diff
                        --dirstat --dirstat= --dirstat-by-file
                        --dirstat-by-file= --cumulative
                        --diff-algorithm=
'
+++ __git_mergetools_common='diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
                        tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc codecompare
'
+++ __git_fetch_recurse_submodules='yes on-demand no'
+++ __git_fetch_options='
        --quiet --verbose --append --upload-pack --force --keep --depth=
        --tags --no-tags --all --prune --dry-run --recurse-submodules=
'
+++ __git_format_patch_options='
        --stdout --attach --no-attach --thread --thread= --no-thread
        --numbered --start-number --numbered-files --keep-subject --signoff
        --signature --no-signature --in-reply-to= --cc= --full-index --binary
        --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
        --inline --suffix= --ignore-if-in-upstream --subject-prefix=
        --output-directory --reroll-count --to= --quiet --notes
'
+++ __git_log_common_options='
        --not --all
        --branches --tags --remotes
        --first-parent --merges --no-merges
        --max-count=
        --max-age= --since= --after=
        --min-age= --until= --before=
        --min-parents= --max-parents=
        --no-min-parents --no-max-parents
'
+++ __git_log_gitk_options='
        --dense --sparse --full-history
        --simplify-merges --simplify-by-decoration
        --left-right --notes --no-notes
'
+++ __git_log_shortlog_options='
        --author= --committer= --grep=
        --all-match --invert-grep
'
+++ __git_log_pretty_formats='oneline short medium full fuller email raw format:'
+++ __git_log_date_formats='relative iso8601 rfc2822 short local default raw'
+++ __git_merge_options='
        --no-commit --no-stat --log --no-log --squash --strategy
        --commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit
        --verify-signatures --no-verify-signatures --gpg-sign
        --quiet --verbose --progress --no-progress
'
+++ __git_push_recurse_submodules='check on-demand'
+++ __git_send_email_confirm_options='always never auto cc compose'
+++ __git_send_email_suppresscc_options='author self cc bodycc sob cccmd body all'
+++ [[ -n '' ]]
+++ __git_complete git __git_main
+++ local wrapper=__git_wrap__git_main
+++ eval '__git_wrap__git_main () { __git_func_wrap __git_main ; }'
+++ complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git
+++ __git_complete gitk __gitk_main
+++ local wrapper=__git_wrap__gitk_main
+++ eval '__git_wrap__gitk_main () { __git_func_wrap __gitk_main ; }'
+++ complete -o bashdefault -o default -o nospace -F __git_wrap__gitk_main gitk
++++ uname -o
+++ '[' Cygwin = Msys ']'
++ . 'C:\Program Files (x86)\Git\mingw32/share/git/completion/git-prompt.sh'
+++ __git_printf_supports_v=
+++ printf -v __git_printf_supports_v -- %s yes
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/lang.sh ']'
+ . /etc/profile.d/lang.sh
++ test -z ''
+++ /usr/bin/locale -uU
++ export LANG=es_ES.UTF-8
++ LANG=es_ES.UTF-8
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/perlbin.sh ']'
+ . /etc/profile.d/perlbin.sh
++ '[' -d /usr/bin/site_perl ']'
++ '[' -d /usr/lib/perl5/site_perl/bin ']'
++ '[' -d /usr/bin/vendor_perl ']'
++ PATH='/c/Users/AlbertoGonzalez/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/AlbertoGonzalez/bin:/c/windows/system32/WindowsPowerShell/v1.0:/c/Program Files (x86)/OpenSSH/bin:/c/Program Files (x86)/SSH Communications Security/SSH Secure Shell:/usr/bin/vendor_perl'
++ '[' -d /usr/lib/perl5/vendor_perl/bin ']'
++ '[' -d /usr/bin/core_perl ']'
++ PATH='/c/Users/AlbertoGonzalez/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/AlbertoGonzalez/bin:/c/windows/system32/WindowsPowerShell/v1.0:/c/Program Files (x86)/OpenSSH/bin:/c/Program Files (x86)/SSH Communications Security/SSH Secure Shell:/usr/bin/vendor_perl:/usr/bin/core_perl'
++ export PATH
+ '[' -n /mingw32 ']'
++ export LC_COLLATE=C
++ LC_COLLATE=C
++ echo '/mingw32/etc/profile.d/*.sh'
+ for file in '$(export LC_COLLATE=C; echo ${MINGW_MOUNT_POINT}/etc/profile.d/*.$1)'
+ '[' -e '/mingw32/etc/profile.d/*.sh' ']'
+ '[' -f /etc/bash.bashrc ']'
+ . /etc/bash.bashrc
++ [[ -z '' ]]
++ CYG_SYS_BASHRC=1
++ [[ himxBH != *i* ]]
++ shopt -q login_shell
+ '[' -n /mingw32/share/aclocal:/usr/share/aclocal ']'
+ export ACLOCAL_PATH
+ export PATH MANPATH INFOPATH PKG_CONFIG_PATH USER TMP TEMP PRINTER HOSTNAME PS1 SHELL tmp temp
+ test -n xterm
+ unset PATH_SEPARATOR
+ '[' false = true ']'
+ unset MAYBE_FIRST_START
+ '[' -f /c/Users/AlbertoGonzalez/.bashrc ']'
+ . /c/Users/AlbertoGonzalez/.bashrc
++ SSH_ENV=/c/Users/AlbertoGonzalez/.ssh/environment
++ '[' -f /c/Users/AlbertoGonzalez/.ssh/environment ']'
++ . /c/Users/AlbertoGonzalez/.ssh/environment /dev/null
+++ SSH_AUTH_SOCK=/tmp/ssh-EorBThENQ9Kx/agent.6896
+++ export SSH_AUTH_SOCK
+++ SSH_AGENT_PID=7596
+++ export SSH_AGENT_PID
++ ps -ef
++ grep 7596
++ grep 'ssh-agent$'
++ __git_ps1
++ local exit=0
++ local pcmode=no
++ local detached=no
++ local 'ps1pc_start=\u@\h:\w '
++ local 'ps1pc_end=\$ '
++ local 'printf_format= (%s)'
++ case "$#" in
++ printf_format=' (%s)'
++ local ps1_expanded=yes
++ '[' -z '' ']'
++ '[' -z '4.3.42(5)-release' ']'
++ shopt -q promptvars
++ local repo_info rev_parse_exit_code
+++ git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
++ repo_info=
++ rev_parse_exit_code=128
++ '[' -z '' ']'
++ return 0

Disconnecting the network goes a little better but still slow.

By putting ssh -v, the version number does not display. Can you go around the problem?

$ ssh -v
+ ssh -v
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file]
           [-L address] [-l login_name] [-m mac_spec]
           [-O ctl_cmd] [-o option] [-p port]
           [-Q cipher | cipher-auth | mac | kex | key]
           [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]
++ __git_ps1
++ local exit=255
++ local pcmode=no
++ local detached=no
++ local 'ps1pc_start=\u@\h:\w '
++ local 'ps1pc_end=\$ '
++ local 'printf_format= (%s)'
++ case "$#" in
++ printf_format=' (%s)'
++ local ps1_expanded=yes
++ '[' -z '' ']'
++ '[' -z '4.3.42(5)-release' ']'
++ shopt -q promptvars
++ local repo_info rev_parse_exit_code
+++ git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
++ repo_info=
++ rev_parse_exit_code=128
++ '[' -z '' ']'
++ return 255

I do not know what's happening. Must be ssh configuration or some Git configuration file that is not remove when uninstalling.

Can anybody help me?

Thanks.

Community
  • 1
  • 1
Alberto
  • 11
  • 4
  • 1
    It does not sound like it but if your HOME is on a network share everything will be very slow. – RedX Jan 22 '16 at 09:16
  • I routinely see operations like `git fetch` take _more_ than 5 seconds on my setup. This is not surprising, because the bash has to make calls over the network to the remote server. Are you sure that the operations you think are slow _should_ be much faster? – Tim Biegeleisen Jan 22 '16 at 09:17
  • @TimBiegeleisen and OP, is bash itself fast? How long does it take to do a plain `ls` and seeing the prompt again. That alone is slow for me sometimes, so it isn't gits fault. – RedX Jan 22 '16 at 09:19
  • Well, for a start, `ssh -v` isn't supposed to give you the version, it's supposed to up the verbosity level. You can also use `-vv` for more debug output and `-vvv` for insane levels of debug output. – paxdiablo Jan 22 '16 at 09:20
  • On my system: real 0m0.121s – paxdiablo Jan 22 '16 at 09:20
  • All other programs work well. The operations like 'ls' or 'pwd' should be the time and take 3 to 5 seconds. A few days ago it worked well. It must be a configuration file Git. – Alberto Jan 22 '16 at 09:21
  • @RedX I'm using git bash terminal in Windows 7. 'ls' takes 6 seconds – Alberto Jan 22 '16 at 09:32
  • Is there a way to uninstall and remove all files Git in the system? – Alberto Jan 22 '16 at 09:45
  • After 1000 tests I found the problem. Start git bash with connection to network takes 20 seconds and a ls command takes 5 seconds. Offline start takes 3 seconds and ls command takes 1 second. I do not understand. – Alberto Jan 22 '16 at 13:35
  • Reminds me of this: https://github.com/git-for-windows/git/issues/193 – eckes Jan 22 '16 at 14:05

0 Answers0