github大文件无法上传

将本地文件更新到github时,遇到如下问题:

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 8756e0d10b2fb95c8b6974bbb8dac04efccdf70b4d52dd0fe1abb4248cdf229f
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File summary/20201029_summary.pptx is 274.76 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/jaspershen/ryan_microsampling
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/jaspershen/ryan_microsampling'

原因是有大文件(>100 M),所以无法上传,但是因为已经git add了,删除也无法消除问题,所以需要使用下面命令:

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch fixtures/11_user_answer.json'

然后再push即可.

Avatar
Xiaotao Shen
Postdoctoral Research Fellow

Metabolomics, Multi-omics, Bioinformatics, Systems Biology.

Related

Next
Previous
comments powered by Disqus