您的位置:首页 > 其它

git error Large files detected解决办法

2017-11-03 17:17 471 查看

错误详情

remote: warning: Large files detected.
remote: error: this exceeds file size limit of 100.0M




参考官方说明:

https://help.github.com/articles/removing-files-from-a-repository-s-history/

但是这种方式只能清除最近的提交到版本库但未推送到远程仓库的文件

解决办法

这个方法里面提供了两种解决方案,https://help.github.com/articles/removing-sensitive-data-from-a-repository/

第一种方式,使用BFG repo-cleaner,

https://rtyley.github.io/bfg-repo-cleaner/

但是要使用java环境运行,我windows使用的git bash没有设置Java路径所以就没有用这种方式;

第二种方式,使用git-filter-branch

首先,清除异常的文件QMPlayer.VC.db

git filter-branch --indx-filter 'git rm --cached -- ignore-unmatch QMPlayer.VC.db' --tag-name-filter cat -- --all




然后修改
.gitignore
,提交

echo "QMPlayer.VC.db" >> .gitignore
git add .gitignore
git commit -m "Add QMPlayer.VC.db to .gitignore"


然后强制推送版本仓库

git push -f origin


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐