git large pack file, delete and rewrite?

后端 未结 1 412
难免孤独
难免孤独 2021-02-06 00:15

I have a relatively small git repository containing a standard Wordpress installation. However, I accidentally added a \"concept\" folder in the repository which contains many l

相关标签:
1条回答
  • I mentioned before that a git gc alone can actually increase the size of the repo).

    The commands I was listing were:

    # remove the temporary history git-filter-branch otherwise leaves behind for a long time
    rm -rf .git/refs/original/ && git reflog expire --all &&  git gc --aggressive --prune=now
    

    If that doesn't work, check out the BFG tool.

    You will find an even more complete gc in "How to remove unreferenced blobs from my git repo"

    This article suggests a similar approach:

    rm -rf .git/refs/original/
    git reflog expire --expire=now --all
    git fsck --full --unreachable
    git repack -A -d
    git gc --aggressive --prune=now
    
    0 讨论(0)
提交回复
热议问题