Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Status Takes a Long Time to Complete

Tags:

git

windows

I'm using git to manage files in a local directory on a Windows machine - no network is involved here, I'm not pushing or pulling to/from another machine. My directory has maybe 100 files in it, all test files, pretty small. When I run git status, it regularly takes 20-30 seconds to complete. Is this normal? Is there anything I can do to speed it up, or a better way to see what the state of my repository is (changed files, untracked files, etc)? Other git commands seem to complete much faster.

like image 514
Matt McMinn Avatar asked Jul 26 '09 04:07

Matt McMinn


People also ask

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.

Why git add take so long?

Git slowness is generally from large binary files. This isn't because they're binary, just because binary files tend to be large and more complex to compress & diff. Based on your edit indicating the file sizes, I suspect this is your problem.

Why does git status hang?

If you are using Windows, check to see if some Windows process has some file or files in that repository locked. If so, your git command will wait for that other process to release the lock, before proceeding. If that other process never lets go, Git never proceeds.


1 Answers

Have you tried git gc? This cleans cruft out of the git repo.

like image 163
Scott Avatar answered Oct 08 '22 14:10

Scott