Git repository size remains large on remote (Gitlab) after purging of large files with git filter-branch then git push --force

Aly Shmahell

I have followed the instructions on Gitlab's docs about "Reducing the repository size using Git " by purging of large files from history: https://docs.gitlab.com/ee/user/project/repository/reducing_the_repo_size_using_git.html
The instructions, and I quote, are as follows:

git checkout master
git filter-branch --force --tree-filter 'rm -f path/to/big_file.mpg' HEAD
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push --force origin master

I then deleted my local repository, and cloned again from remote, the size has been reduced, from 600mb to 90mb upon cloning, but still on the Gitlab repository page it says the size is 600mb.

Does anyone know why I'm seeing this behavior, and how to fix it?

Aly Shmahell

It was an error on my behalf not reading the docs thoroughly, I quote from the Gitlab docs:

Note that even with that method, until git gc runs on the GitLab side, the "removed" commits and blobs will still be around. And if a commit was ever included in an MR, or if a build was run for a commit, or if a user commented on it, it will be kept around too. So, in these cases the size will not decrease.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related