github push文件过大(>100M)从本地仓库中移除文件及添加文件

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

本文链接: https://blog.csdn.net/qq_15052199/article/details/100281590

1.从本地仓库中移除过大文件

github push文件过大,error: GH001: Large files detected. this exceeds GitHub's file size limit of 100 MB

#Stage our giant file for removal, but leave it on disk
git rm --cached giant_file
# Amend the previous commit with your change
#Simply making a new commit won't work, as you need
#to remove the file from the unpushed history as well
git commit --amend -CHEAD
#Push our rewritten, smaller commit
git remote add origin git@github.com:yy2536298120/MXNet-Demo.git
#将本地仓库项目更新提交到GitHub仓库项目中
git push -u origin master

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

2.添加1步骤误删除的小于100M的文件

#执行添加:cd到本项目需要添加的文件目录下
git add file_name.xxx
#提交注释
git commit -m "add commit"
#将本地仓库项目更新提交到GitHub仓库项目中
git push -u origin master

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值