git提交大文件失败

50Mb push 警告

[plain]  view plain  copy
  1. remote: warning: Large files detected.  
  2. # remote: warning: File big_file is 55.00 MB; this is larger than GitHub's recommended maximum file size of 50 MB  

100Mb push 限制

[plain]  view plain  copy
  1. remote: warning: Large files detected.  
  2. # remote: error: File giant_file is 123.00 MB; this exceeds GitHub's file size limit of 100 MB  

移除大文件,注意备份。

[plain]  view plain  copy
  1. $git rm --cached giant_file  
  2. # Stage our giant file for removal, but leave it on disk  
  3.   
  4. $git commit --amend -CHEAD  
  5. # Amend the previous commit with your change  
  6. # Simply making a new commit won't work, as you need  
  7. # to remove the file from the unpushed history as well  
  8.   
  9. $git push  
  10. # Push our rewritten, smaller commit  

版权声明:本文为zzuchenyb原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。