3

I'm trying to reduce the size of a repository I have hosted on GitHub.

Previously, I had a web app in there that I moved to a separate repo with a filter-branch. So,there are a bunch of objects in there that I can clean up.

This is what I tried so far.

Found the objects in .git directory that are taking most space

git verify-pack -v .git/objects/pack/pack-69f30fd80611b43114487a13bd0acce8ca591d65.idx | sort -k 3 -n | tail -10

Looked up what those objects where

git rev-list --objects --all | grep 791b9d08eca70

791b9d08eca70f4070bee37e0f8743172d6218c5 static/js/main.d4d0a6ad.js.map

I don't need these.

So, I did a git prune

git gc --aggressive --prune=now

I see that the size had gone down from 180 MB to 56 MB.

Now I want the remote in GitHub to reflect the same but I'm not sure how to push these changes there. I don't see any changes if I do git status.

I tried

git push --all --force

Everything up-to-date

That doesn't change anything either.

sudo bangbang
  • 27,127
  • 11
  • 75
  • 77
  • 1
    See if [this previous question](https://stackoverflow.com/questions/27867775/how-to-cleanup-garbage-in-remote-git-repo/37253227) helps you. – gigalul Jul 27 '19 at 14:17
  • 1
    GitHub will do their own cleanup of that repository (their own `git gc`, with their chosen parameters) ... *eventually*. You've already updated their copy of the repository as indicated by the fact that pushing all branches with `--force` did not change anything. (But if you had some tags, make sure you push those with `--force` as well.) – torek Jul 27 '19 at 19:12

0 Answers0