git error Large files detected解决办法

错误详情

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

image

参考官方说明:
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

filter-branch

然后修改.gitignore,提交

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

然后强制推送版本仓库

git push -f origin

push success

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值