1

I have a project that contains some large folders that I ignore through .gitignore, but when I git add and commit I find that the ratio is smaller but not as expected, the following error occurs in the final stage of git push

Total 8494 (delta 285), reused 8494 (delta 285)
error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502 Bad Gateway
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

The project size is as follows

# du -h --max-depth=1 .
...
...
4.2G    ./.git
...
...
16G     ./project
20G     .

My project uses Gitllab for repository.

I would appreciate it if you could tell me how to solve it.

moluzhui
  • 1,003
  • 14
  • 34
  • I can't say for sure whether this is due to the large project size or a separate network issue. If it is the size however, you should consider using Git Large File Storage: https://docs.gitlab.com/ee/topics/git/lfs/ – Daly Dec 16 '20 at 03:27

1 Answers1

1

First, use github/git-sizer to get an idea of what is taking so much space.

Then try and delete any large file (that you now .gitignore, but which is still part of your past commit history)

For that, use git filter-repo (that I mentioned here).

Install it first. (python3 -m pip install --user git-filter-repo)

Then, for example:

git filter-repo --strip-blobs-bigger-than 10M
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250