Speed up git bash on Windows

posted in How-to by duane

Recently, I've been struggling with performance in Git Bash on Windows. Just doing a 'git status' takes several seconds.

Directory browsing was also crazy slow, just TAB completing possible filenames was taking a few seconds.

After doing a bit of Googling, I found a few tips that made a huge difference to my experience.

Make the following changes to you git config:

Another speedup came when I redefined my shell prompt. By default, the bash shows you which branch you're currently on, and for some reason the method it uses to get the branch is quite slow.

I found the following change on a StackOverflow post that seems to work way faster:

  1. Go to your git install directory (Mine is c:\Program Files (x86)\Git
  2. In the etc folder, open the file 'profile' in a text editor
    • This file is executed when the bash shell is initialized, you can do a lot of customization in here
  3. Near the bottom, you will find some commands related to setting a variable called PS1 (PS1 = ...)
  4. Either replace it or just append the following lines after it

Make sure the PS1 variable is not changed again later in the script.


These tips all came from a StackOverflow post: http://stackoverflow.com/questions/4485059/git-bash-is-extremely-slow-in-windows-7-x64, there may be more there to help, but just the above changes made a massive change for me.

Git Windows Bash



There are no comments yet.