Git 常见错误

Github 大文件删除之后依旧push不上

Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (24/24), 201.06 MiB | 1.36 MiB/s, done.
Total 24 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), completed with 2 local objects.
remote: warning: File model/news.model is 73.08 MB; this is larger than GitHub’s recommended maximum file size of 50.00 MB
remote: warning: File data/user_click_data.tar.gz is 74.27 MB; this is larger than GitHub’s recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: a092a0b034ec52cbdd5c6fda7852c00c
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File src/data-utils/train_original.csv is 155.62 MB; this exceeds GitHub’s file size limit of 100.00 MB
To github.com:XingwXiong/NewsRS.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ‘git@github.com:XingwXiong/NewsRS.git’

解决办法:

1
2
3
$ git filter-branch --index-filter \
'git rm -r --cached --ignore-unmatch src/data-utils/train_original.csv' HEAD
$ git push origin master
坚持原创技术分享,您的支持将鼓励我继续创作!