First things first the fix for my problem was:
git config –global gc.auto 0
If you want to check if it’s the same problem read on.
For the last too many days I was plagued with a painfully slow git pull.
We’re talking 10s of minutes.
The output looked something like this:
[peterd@localhost RPM]$ git pull && git push
remote: Counting objects: 154, done.
10e4472..3a946c4 release4.4 -> origin/release4.4
* [new tag] 4.4.201811200009 -> 4.4.201811200009
Auto packing the repository for optimum performance.
See “git help gc” for manual housekeeping.
Counting objects: 124257, done.
Compressing objects: 100% (77491/77491), done.
Writing objects: 100% (124257/124257), done.
Total 124257 (delta 43818), reused 116277 (delta 39818)
This solution was not the first I tried. But it works. The key line here is the one in bold. It tells us git gc is automatically called after git pull.
It goes over all files in the history of the repository and repackages them for optimal disk usage. The command I gave you first disables this auto calling of git gc.
Funny that it just says “optimum performance” when it actually bumped every pull with 30+minutes in my case 🙂