1

When I run git fetch production to fetch objects from my remote repository hosted on Gitlab, I get the following in my terminal -

remote: Counting objects: 100% (4895/4895), done.
remote: Compressing objects: 100% (515/515), done.
Receiving objects:  25% (11199/44589), 476.81 MiB | 3.42 MiB/s   

This seems to take forever, because each object seems to be large in size.

The fun part is - I've absolutely no clue which are these objects; because I've double-checked my local repository; and all I have is Laravel Framework, with my custom code; and no big packages. I'd estimate max size of my repository should not be greater than 200 - 300 MB.

Is there any way to troubleshoot this? It's driving me nuts!

Update: While I was composing this question, the terminal threw the following -

Receiving objects: 100% (44589/44589), 1.14 GiB | 3.39 MiB/s, done.
Resolving deltas: 100% (28324/28324), done.

The objects size seems to have gone down from 44589 -> 28324. Can someone help me figure out what's going on and how can I speed up my git pulls and git fetches?

TheBigK
  • 451
  • 5
  • 17

1 Answers1

1

First, you ca quickly list the large objects in your repository.

Second, you can then proceed and delete some of those object in the history of your repository (meaning your current checked out working tree might be small, but large objects might have been committed, then removed, and their presence is still felt when cloning a repository)
You would need to use git filter-repo.


On the server side:

See GitLab 14.5 (November 2021)

Git fetch resource optimizations

Git fetch resource optimizations

We improved the performance of traffic between Workhorse and Gitaly, resulting in git fetch now using fewer GitLab server resources.

This change can cause issues on self-managed GitLab if a gRPC proxy is deployed between Workhorse and Gitaly.

If you deployed a gRPC proxy between Workhorse and Gitaly, Workhorse can no longer connect. As a workaround, disable the temporary workhorse_use_sidechannel feature flag.
If you need a proxy between Workhorse and Gitaly, use a TCP proxy.

See Documentation and Issue.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • That command did the job. I got a large number of entries in following format: `63e9a6bdd152 379839 public/apps/downloads/CrazyEngineers-6363-software-companies-placement-papers-huge-collection-6ZvE1l.zip` . If I run the `git filter-repo` command, do I need to commit and push changes? – TheBigK Mar 06 '20 at 06:53
  • @TheBigK Yes, that will be a `git push --force` (so make sure to notify any collaborator using that repo), because filter-repo will rewrite the sequence of commits of your local repository. You can first test out that filter on a copy of your local repository, just to check that the overall size is indeed lower after. – VonC Mar 06 '20 at 07:00