github 拉取大项目+更新fork的代码到本地

1.拉去大项目

GitHub拉取大一点的项目会报以下错误:

remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
fatal: The remote end hung up unexpectedlyiB | 31.00 KiB/s
fatal: early EOF
fatal: index-pack failed

这里尝试一种方法,原文链接是:https://stackoverflow.com/questions/38618885/error-rpc-failed-curl-transfer-closed-with-outstanding-read-data-remaining

$ git clone http://github.com/yours --depth 1

$ cd yours
$ git fetch --unshallow

先clone一层,然后进入你的项目路径更新

 

2.更新项目

先在github网站上更新,参考文章:https://blog.csdn.net/qq1332479771/article/details/56087333

 

git remote -v
#查看源
$ git remote add upstream git@github.com:yours.git
#添加源upstream

只拉一层后再更新最新的提交,最后合并

$ git fetch upstream --depth 1
#只拉取最新的更改
cd yours
$ git fetch --unshallow
$ git merge upstream/master
git push

以上

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值