I am trying to reduce the size of my repository, currently about 9.7GB. So I proceeded as follows:
-
Export the project bundle from my repository.
-
extract the downloaded project bundle.
$ tar xzf 2022-02-22_12-50-017_my_project_export.tar.gz
- Clone the export project bundle.
$ git clone --bare --mirror project.bundle
Cloning into bare repository 'project.git'...
Receiving objects: 100% (1310/1310), 9.73 GiB | 44.38 MiB/s, done.
Resolving deltas: 100% (232/232), done.
- Change to project.git repo.
$ cd project.git
- Analyze repo.
$ git filter-repo --analyze
Processed 1066 blob sizes
Processed 54 commits
Writing reports to ./filter-repo/analysis...done.
- Purge files larger than 50M
$ git filter-repo --strip-blobs-bigger-than 50M
Processed 1066 blob sizes
Parsed 54 commits
New history written in 0.05 seconds; now repacking/cleaning...
Repacking your repo and cleaning out old unneeded objects
Enumerating objects: 1247, done.
Counting objects: 100% (1247/1247), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1036/1036), done.
Writing objects: 100% (1247/1247), done.
Building bitmaps: 100% (48/48), done.
Total 1247 (delta 212), reused 1181 (delta 189), pack-reused 0
Completely finished after 16.05 seconds.
- Delete remote origin
$ git remote remove origin
Note: Some branches outside the refs/remotes/ hierarchy were not removed;
to delete them, use:
git branch -d dev
git branch -d master
$ git remote add origin https://gitlab.com/my_project.git
- Force push your changes to overwrite all branches on GitLab.
$ git push origin --force 'refs/heads/*'
Username for 'https://gitlab.com': arilwan
Password for 'https://arilwan@gitlab.com':
Enumerating objects: 1247, done.
Writing objects: 100% (1247/1247), 2.05 GiB | 20.38 MiB/s, done.
Total 1247 (delta 0), reused 0 (delta 0), pack-reused 1247
error: RPC failed; HTTP 524 curl 22 The requested URL returned error: 524
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
Can you suggest how this could be resolved?