My GitLab repo size was too large so I decided to reduce its size using BFG. I managed to bring it down from 3.8 GB to 2.7 GB by basically removing all folders and only letting scripts (.py files that were not in any folder) remain. I even ran Housekeeping afterward. But my GitLab size is still stuck at 2.7 GB but when I clone my repo the size of the cloned repo is 150 MB. This seems like a problem on Gitlab's end. Has anyone ever encountered a problem like this before?
Asked
Active
Viewed 695 times
1
-
1A large repo at "their" end (whoever "they" are) that clones to a small repo at "your" end (you at least know who you are :-) ) indicates that they're hanging on to old data. So, whoever they are, you should contact them (who *are* they anyway? "GitLab" as an entity is pretty ambiguous) and see if you can get them to flush out stale data. – torek Oct 14 '21 at 00:22
-
3In Gitlab repositories, there are some special refs for internal usage. The user can't fetch them and can't check them by `git ls-remote` either. If you have access to the repository in Gitlab server, you can run `git for-each-ref` in the server repository to see all of them. Some of the "removed" objects are no longer referred to by any branches or tags, so the user can clone and receive a much smaller client repository. But the internal refs still point to these large objects, so the size of the server repository does not shrink as much as you expect. – ElpieKay Oct 14 '21 at 02:04
-
1Can you just re-upload your new repo and delete the old one? (Assuming you absolutely don't need the old one ever again...) – TTT Oct 14 '21 at 06:00
-
It is my company's gitlab. Should I contact them for specifics? Maybe they can look at my gitlab repo and see if there are any big files out there – Oct 14 '21 at 09:57
-
1@TTT Removing a project not only deletes the repo but also deletes configuration (like the list of users and their access rights), issues and wikis; quite an undesirable effect usually. – phd Oct 14 '21 at 11:14
-
@phd excellent point! Perhaps contacting Gitlab support would be helpful. [This old thread](https://forum.gitlab.com/t/how-can-i-delete-a-repository-and-push-a-new-one/690/10) implies there may be a way to delete *only* the repo and re-upload without losing all the meta data such as issues, etc, in the project. I don't know if branch specific level security can be persisted. – TTT Oct 14 '21 at 16:14
-
Also, if you do contact GitLab support, they may be able to tell you why the repo is still so big. For example, maybe it just hasn't been garbage collected yet and in a few months it will be smaller again. Or, maybe they can force garbage collection now. Or, maybe old pointers from previous MRs will prevent it from ever shrinking. – TTT Oct 14 '21 at 16:20