Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Bash (mintty) is extremely slow on Windows 10 OS

I installed Git on my Windows 10 a couple of months ago. It worked well for some time. But now, it's running very slow.

The git status command takes 7 seconds to execute, and git stash takes many minutes for stashing (even if there is nothing to stash). Also, I would like to point out that git status prints the result instantaneously, but I can not enter a new command for a few seconds, as shown in the image below.

The screen is stuck like this for 7 seconds

I have tried solutions to similar problems like link1, link2, etc., but none of these have worked.

P.S.: I use Windows Defender antivirus, and it is NOT making my Bash slow. Also, cmd takes more time to execute git commands while git bash takes longer to run any command.


Update: I have switched to Ubuntu, and therefore, I don't use Windows presently. So, there is no way I can check if any of the solutions work for me. I have accepted the answer provided by @pschild since it has the most upvotes and seems to have worked for many people.

like image 417
Rohan Bhatia Avatar asked Mar 19 '17 14:03

Rohan Bhatia


People also ask

How do I make Git bash open faster?

Open the Start menu by clicking on the Windows icon and typing “Git Bash” into the search bar. The icon for Git Bash and the words “Git Bash Desktop App” will appear. Click on the icon or the words “Git Bash Desktop App” to open Git Bash. 5.

Is Git Bash good for Windows?

Git Bash is packaged with additional commands that can be found in the /usr/bin directory of the Git Bash emulation. Git Bash can actually provide a fairly robust shell experience on Windows.

Why is Git status slow?

The first thing to determine is if the poor behavior is due to your machine or to your specific local copy of the repo. The files in your . git folder can affect performance in various ways - settings in . git/config , presence of lfs files, commits that can be garbage collected, etc.


2 Answers

I recently ran into the exact same issue. After trying all the advice from this thread and a lot of other threads, I finally found a solution here, respectively in the linked issue here.

Disabling AMD Radeon graphics driver in the Windows device manager and switching to integrated Intel HD graphics worked for me - for whatever reason.

Hope that helps!

In my case, I found sh.exe shell to be significantly faster than bash.exe. You can find sh.exe in git_install_dir/bin.

Hope this helps people having this issue while only having integrated Intel HD graphics!

like image 77
pschild Avatar answered Sep 27 '22 22:09

pschild


For me, the solution was to set the HOME variable to my user directory (per this answer). To do this (at least on Windows 7):

  1. Right-click on "Computer" in file explorer.
  2. Open Advanced System Settings.
  3. Open Environment Variables
  4. Under System Variables, click "New..."
  5. Enter "HOME" for the variable name and the path to your user directory for the value (for example "C:\Users\jdoe").

See also the answers to this related question.

like image 37
Paul Wintz Avatar answered Sep 27 '22 23:09

Paul Wintz