6

I have a small problem with git in my pc, I create a new folder and i start Git Bash, but it takes so long for it load git, as in it will show the command prompt but it need a while for the git line to show up.

Any clue on this?

Thanks

Daniel Mahadi
  • 848
  • 1
  • 10
  • 14
  • Could you define "slow" ? 5s, 10s, minute ? It takes maybe 5s on my machine (relatively weak) ... but how often, does one load it anyways ? (I leave it in the background). – Rook Jan 05 '10 at 05:11
  • 1
    @Daniel: maybe you want to fill in your question with more details about your PC, OS, etc. as those seem to be relevant to diagnosing the problem. – mechanical_meat Jan 05 '10 at 05:12
  • @adam: win 7, xeon processor 2.2 ghz, 2 gb ram @Idigas: it just like stuck there for like 20 s, if it is blank, and take longer if there is a local repo in it. – Daniel Mahadi Jan 05 '10 at 06:04
  • The "Git Bash" menu option doesn't actually do any Git things, but just starts an instance of MSYS bash. Unless, of course, you've got something like your prompt configured to show the current Git branch (which I suppose is a possibility). So, this seems unlikely to be related to Git. – Greg Hewgill Jan 05 '10 at 06:13
  • @Greg: agree, it is the bash. But is there anything i can do to speed it up, i have do an experiment, i can start the bash from Git folder it is faster (But it slow sometimes), but if i start bash from project folder it is slower. – Daniel Mahadi Jan 05 '10 at 09:39
  • No news on this? I have the same problem, though it's only about 10 seconds. It's really pestering. And no, I don't want to use `cmd`, I like Git Bash the way it is, only it should be faster on startup.. Any ideas? – Gui Prá Feb 18 '10 at 04:14
  • I have the same problem, it is noticeably slower than when I installed. It is not related to repository size, because even starting in a non-git folder shows the same slowness. – Benjol Jun 04 '10 at 07:22
  • Hi, Guys. I decided to use [Powershell with Git][1]. It works great and fast. you can even wire other git UI, like [QGIt][2] (I found it richer then the Git Gui and Gitk). [1]: http://tiredblogger.wordpress.com/2009/08/21/using-git-and-everything-else-through-powershell/ [2]: http://sourceforge.net/projects/qgit/ – Daniel Mahadi Feb 21 '11 at 12:22

6 Answers6

5

I had a similar problem. Turned out that the home directory was on a network drive and this caused alot of slowdown.

You can check your home directory by typing echo $HOME in Git bash. If it points to a network drive you can change it to a local path (for example C:\documents and settings\<login> on XP) by setting the HOME environment variable in Windows.

If start-up is still slow, see if the starting directory for the Git Bash shortcut is %HOMEDRIVE%%HOMEPATH%. If so, try changing it to %HOME%.

Risingson
  • 51
  • 1
  • 1
  • I had the exact same issue. Basically, either disconnect network drives (which will speed up the git.cmd script), or perhaps do the above. – cgp Feb 09 '12 at 00:53
2

You may not be aware that you don't actually need to use the "Git Bash" shell. If you add the directory containing git.exe to your PATH environment variable, then you can simply run git commands from the regular Windows command prompt.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • 1
    @jpartogi - A little (subjective feeling; cannot verify now) - but you'll lose all the "sparks and stars" (colors in shell and the like). The advantage (or disadvantage) is that you're using cmd instead of bash. – Rook Jan 05 '10 at 05:43
1

Could you check your .bashrc?

Sometime, a prompt a little too much sophisticated can render the shell slow to respond.
See this blog entry as an illustration.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @Vonc: I cannot find such file. Where is it usually reside? – Daniel Mahadi Jan 05 '10 at 09:37
  • @Daniel: On windows, in your user home directory (`c:\Users\login` for Vista and Seven, `C:\Document And Settings\login` for Xp) – VonC Jan 05 '10 at 09:53
  • @Vonc: I think i dont have that kind of setting. I cant find the file under c:\users\\ – Daniel Mahadi Jan 05 '10 at 10:04
  • @Daniel: and in `C:\cywgin\`? – VonC Jan 05 '10 at 12:42
  • @Daniel: are you using MSysGit? MSysGit creates all its dotfiles as hidden files. If you want to be able to see `.bashrc` in the explorer, you have to modify your vew settings to also show hidden files. Or, you could just blindly type `%UserProfile%\.bashrc` into the open dialog of your favorite text editor. It'll be there. – Jörg W Mittag Jan 05 '10 at 13:56
  • @Jorg: Yes, i am using MSysGit, the file is not there – Daniel Mahadi Jan 07 '10 at 02:31
  • What's weird is that if I close the bash window and reopen one, it's very fast. It's on the first try that it's slow. – Benjol Jun 04 '10 at 07:25
1

Any users having slowness problems in Windows 7 may like to check out this related question which explains that it is because of UAC. The solution is to Run as Administrator.

Unfortunately this doesn't resolve the symptoms described in the question (just slow at startup) on my XP machine.

Community
  • 1
  • 1
Benjol
  • 63,995
  • 54
  • 186
  • 268
  • Note: if this resolves your problem, please don't mark it as the answer, at least not without changing the question title to include the fact that it is on Windows7 and not just at startup! – Benjol Sep 14 '10 at 09:16
  • It doesn't. I have UAC turned off. Somehow it just got fast some time ago, but thanks for your time. – Gui Prá Sep 14 '10 at 13:52
  • what? I thought I had asked this question. Just seen now it wasn't me. Sorry :p – Gui Prá Sep 14 '10 at 13:53
1

Upgrading to the latest version (1.7.3.1) seems to have resolved this problem for me, on XP.

Benjol
  • 63,995
  • 54
  • 186
  • 268
0

I have get the same problem, each "Entry" need more than 10 seconds to get response. And also need more than 20 seconds to start the shell. I have re-install the git, the problem also existed. So I think about that what I have done at recent days, I have add some dir to the PATH, and I have add many tools into the directory. So, I try to remove the directory from the PATH, and after that, the Shell returned to normal.

$ cat ~/.profile
#!/bin/bash

#export PATH=$PATH:"/c/Program Files/qemu/"
#export PATH="/d/rootfs/bin":"/d/rootfs/usr/bin":$PATH

#export PATH="/c/Program Files (x86)/CodeBlocks/MinGW/bin":$PATH

#export LD_LIBRARY_PATH="/d/rootfs/lib/"

alias ..="cd .."
alias ll="ls -l"
#alias make=mingw32-make.exe
#alias bash=bash.exe
#alias sh=sh.exe
Jimmy
  • 223
  • 1
  • 11