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

前端 未结 2 516
情深已故
情深已故 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.

    0 讨论(0)
  • 2020-12-10 06:14

    I am sorry folks!!! In addition to node_module there was another main culprit ntvs_analysis.dat that caused the huge size of the repo. Now I have removed that and now the repo size is 75 MB. Even the steps that I have followed itself was working

    0 讨论(0)
提交回复
热议问题