Removing unwanted folders from git repo permanently - Repo size not changing

前端 未结 2 528
情深已故
情深已故 2020-12-10 05:40

I have git repo, I have accidentally committed some library files to the git remote repo.

Now it has resulted in increased size of about 6.23 GB. Then I tried deleti

2条回答
  •  悲哀的现实
    2020-12-10 05:55

    I mention in Git pull error: unable to create temporary sha1 filename that git gc alone isn't enough.

    One combination which should bring down the size of the repo should be:

    git gc
    git repack -Ad      # kills in-pack garbage
    git prune           # kills loose garbage
    

    However, This must follow any cleanup of big file (git filter-branch), and that is only for the local repo.

    After pushing (git push --force) to the remote repo, said remote repo won't benefit from the same size reduction. A gc/repack/prune needs to be done on the remote side as well.

    And if that remote side is TFS... this isn't easy/possible to do for now.

提交回复
热议问题