Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git gc and git pull locks up machine and never finishes

When running git gc, git gets up to 99% complete and then locks up. I let it run all night and it never finished, and did not seem to progress. Generally I have to hard-reset the machine to recover because everything locks up. Because the machine becomes completely unresponsive I can't get top or htop statistics.

I decided to ignore that problem for awhile. Today however, when running a git pull, git decided to auto pack the repository, which triggered this same error.

This is where it gets stuck:

Auto packing the repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
Counting objects: 428464, done.
Delta compression using up to 4 threads.
Compressing objects:  99% (93702/93718)

This is a Qt 4.8 C++ project on Fedora 17. I have 8GB of RAM and the partition holding the project is 33G with 27G used (88% full).

What could be causing this problem? If the machine lacks resources for running git gc, is there a way to tell git not to auto pack?

like image 279
Freedom_Ben Avatar asked May 22 '13 19:05

Freedom_Ben


2 Answers

https://help.github.com/articles/ignoring-files

If you skip all the generated binaries and the dlls and heavy things in the repository then it shouldn't have a problem with optimization.

Here is how you disable it:

https://www.kernel.org/pub/software/scm/git/docs/git-gc.html

git config --global gc.auto 0

Hope that helps.

like image 200
phyatt Avatar answered Nov 08 '22 04:11

phyatt


Seven years later I am getting the same problem on Debian. This behaviour does seem somewhat sub-optimal.

Workaround: even if the desktop is locked, I can still get to a virtual console (Alt-Ctrl-F1) and log in as root and pkill git to unlock everything.

like image 20
John Lawrence Aspden Avatar answered Nov 08 '22 06:11

John Lawrence Aspden