I am locating all older big git files in my repo using -
$ git rev-list --objects --all
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'
| awk '/^blob/ {print substr($0,6)}'
| sort --numeric-sort --key=2
| cut --complement --characters=13-40
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
using this, I am trying to delete old files through history as below -
$ git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch pathofile.json' --prune-empty --tag-name-filter cat -- --all
$ rm -rf .git/refs/original/
$ git reflog expire --all && git gc --aggressive --prune
but the file still remains. How can I permanently delete old files from my repo so its size is smaller?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…