https://harttle.land/2016/03/22/purge-large-files-in-gitrepo.html
https://www.jianshu.com/p/780161d32c8e
https://www.jianshu.com/p/ed2b6081f529 大文件
git pull origin branchname --allow-unrelated-histories
git filter-branch --force --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch XXX.framework' --tag-name-filter cat -- --all
lfs操作:
-
- 首先需要在git版本库所在目录下对lfs进行初始化。 执行后,在根目录下会生成“.gitattributes”文件。
git lfs install - 添加track规则,下面以后缀为".dat"的二进制文件为例。
git lfs track "*.dat"
执行后,会发现.gitattributes文件多出一行
*.dat filter=lfs diff=lfs merge=lfs -text
说明已经生效。
- 首先需要在git版本库所在目录下对lfs进行初始化。 执行后,在根目录下会生成“.gitattributes”文件。
- 将.gitattributes加入到版本控制中。
git add .gitattributes
git commit -m "add .gitattributes" - 至此,lfs已经配置完成。后续的二进制add、commit、push同正常的代码提交完全一致,只是在push时会显示