Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Bash is slow on startup and commands

Tags:

git

git-bash

Startup and commands is very very slow in windows 8.1 embedded.

When I start git bash, it is turn on 1~2minutes.

I input a command like 'ls', it delay 1~2 minutes.

And ten shell prompt is delayed 1~2minutes,too.

Changing Environment path doesn't work.

like image 601
egaoneko Avatar asked Feb 27 '14 18:02

egaoneko


2 Answers

I found the setting responsible for this problem in the Behaviour Blocker of the HIPS module of Comodo Internet Security:

  • Rightclick the Comodo icon on the notification area and choose: "HIPS" > "Settings"
  • On the left pane, choose "Behaviour Blocker"
  • On the right pane, on the "Advanced" block, click "Exceptions" (or "Exclusions", I'm translating from a Brazilian Portuguese install)
  • Rightclick the background of the list that pops up and choose: "Add" > "Files"
  • Navigate to the Git install dir (usually "c:\program files (x86)\git\") and open the "bin" directory
  • select the "git.exe" executable and click "Open", then "OK" and then "OK" again.

If this didn't work for you, try adding the "git.exe" and "sh.exe" to this list and the anti-virus exclusions.

like image 74
Ricardo Souza Avatar answered Oct 04 '22 06:10

Ricardo Souza


The question seems inactive and answered but I've found some other issue with git bash starting slow, so sharing just in case it's useful for anyone.

In my case the delay of a few seconds was caused by the git-prompt.sh script which was started through bash.bashrc by default. I commented out the last line in the default %GIT_HOME%\etc\bash.bashrc:

shopt -q login_shell || . /etc/profile.d/git-prompt.sh

The benefit: bash starts in less than a second.

The downside: the prompt does not show which branch I'm in.

like image 24
Jacek Avatar answered Oct 04 '22 04:10

Jacek