Git repo still huge after large files removed from repository history

前端 未结 4 456
后悔当初
后悔当初 2021-01-12 19:21

I have a codebase that (until now) used git to store its dependencies. The repository itself is available here (warning: it\'s HUGE). Needless to say, I need to remove the d

4条回答
  •  有刺的猬
    2021-01-12 19:44

    You need to run David Underhill's script on each branch in the repository to ensure the references are removed from all branches.

    Then, as in the further discussion, initialize a new repository with git init and either git pull from the original or git remote add origin and then pull all branches.

    $ du -sh ./BIG
    299M ./BIG
    $ cd BIG
    $ git checkout master
    $ git-remove-history REMOVE_ME
    ....
    $ git checkout branch2
    $ git-remove-history REMOVE_ME
    ...
    $ cd ../SMALL
    $ git init
    $ git remote add origin ../BIG
    $ git fetch --all
    $ git checkout master
    $ cd ..
    $ du -sh ./SMALL ./BIG
    26M ./SMALL
    244M ./BIG
    

提交回复
热议问题