How to remove unreferenced blobs from my git repo

后端 未结 10 2351
轻奢々
轻奢々 2020-11-22 15:07

I have a GitHub repo that had two branches - master & release.

The release branch contained binary distribution files that were contributing to a very large repo

10条回答
  •  [愿得一人]
    2020-11-22 15:16

    You can use git forget-blob.

    The usage is pretty simple git forget-blob file-to-forget. You can get more info here

    https://ownyourbits.com/2017/01/18/completely-remove-a-file-from-a-git-repository-with-git-forget-blob/

    It will disappear from all the commits in your history, reflog, tags and so on

    I run into the same problem every now and then, and everytime I have to come back to this post and others, that's why I automated the process.

    Credits to contributors such as Sam Watkins

提交回复
热议问题