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

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

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.

画面は7秒間このように固定されます

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.

ベストアンサー1

For me, the solution was to set the HOME variable to my user directory (per this answer) via the following steps:

  1. Open Advanced System Settings (see instructions below)
  2. Open Environment Variables
  3. Under System Variables, click "New..."
  4. Enter "HOME" for the variable name and the path to your user directory for the value (for example "C:\Users\jdoe").

Per @Alexandre Jobin's comment, Git Bash can be very slow if your HOME variable points to a shared network folder. See also the answers to this related question for more solutions.

How to Open Advanced System Settings

On Windows 7 through 10, Advanced System Settings are opened by the following steps:

  1. Open the file explorer
  2. Right-click on "Computer."
  3. Open Advanced System Settings.

On Windows 11, the steps are slightly different:

  1. Open the Start menu (either click the ⊞ button in the lower left corner or type the ⊞ Win key).
  2. Type "View Advanced System Settings" in the Search box and hit ENTER.

おすすめ記事