Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
400 views
in Technique[技术] by (71.8m points)

windows - Remove old big azure devops git files

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...