git - Trying to remove files from a super messy repository but they don't seem to be removed -
so we've gone , old project updates, in past no 1 has mentioned how messy repository is. it's old 1 that's got many many commits , seems hasn't been managed.
long story short .git file 4.02gb (yes that's right, gb) in size. i'm trying blast through , remove of old files should never have been tracked in first places (i can see .ipa's , .swfs instantly don't need there).
i've used little shell script atlassian recommend on maintaining git repository has listed out top 10 offenders me helpful i'm having tough time removing files history.
i've tried running git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' head
seems suggest , running garbage collection. i've tried not utilize aggressive gc because it's big takes few hours run. after running gc with: git gc --prune=now
doesn't seem having effect , same files come when run script give me list of biggest files.
what command(s) should using remove file committed of history in repository help cut down size?
you missing these 2 steps the checklist shrinking repository
remove original refs backed git-filter-branch: git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d.
expire reflogs git reflog expire --expire=now --all.
also, avoid git gc --aggressive
instead utilize
git repack -ad --depth=250 --window=250
git
No comments:
Post a Comment