git 删除commit记录中大文件
一、查找 git记录中,10个比较大的文件地址
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -10 | awk '{print$1}')"
二、删除本地
git filter-branch -f --prune-empty --index-filter 'git rm --cached --ignore-unmatch -rf Pods/*' -- --all
git log --pretty=oneline --branches -- DHProject/Vendor/Frameworks/*
git log --pretty=oneline --branches -- DHProject/Resources/Html/jdList/app.js
git log --pretty=oneline --branches -- Pods/*
三、真正删除
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
git push origin master --force
git remote prune origin
四、让远程仓库变小
git remote prune origin
////// CocoaPods 安装更新本地仓库
git clonehttps://github.com/CocoaPods/Specs.git~/.cocoapods/repos/master
卸载cocoapods
sudo rm -rf /usr/local/bin/pod ; gem list | grep cocoapods | awk '{print $1}' | while read line; do sudo gem uninstall $line; done