Introduction

備忘録。
自宅のライブラリ保存用リポジトリが巨大化してpullできなくなりました。
その際の対策。

1
2
3
4
5
6
$ git fetch
remote: Enumerating objects: 8824, done.
remote: Counting objects: 100% (8821/8821), done.
error: RPC failed; curl 56 Failure when receiving data from the peer
fatal: the remote end hung up unexpectedly
fatal: protocol error: bad pack header

How to

下記の方が教えてくれました。

徐々にfetchしてpullすればよいと。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$ git fetch --depth 1
remote: Enumerating objects: 8374, done.
remote: Counting objects: 100% (8374/8374), done.
remote: Compressing objects: 100% (6008/6008), done.
remote: Total 8356 (delta 2189), reused 8277 (delta 2170)
Receiving objects: 100% (8356/8356), 1.31 GiB | 28.65 MiB/s, done.
Resolving deltas: 100% (2189/2189), completed with 9 local objects.
From https://hogehoge:3000/git/Lib
+ 67ccf8298...3fb81d65f master -> origin/master (forced update)
* [new branch] develop -> origin/develop
$ git fetch --depth 10
remote: Enumerating objects: 332, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (154/154), done.R
remote: Total 310 (delta 166), reused 262 (delta 149)
Receiving objects: 100% (310/310), 66.85 MiB | 25.18 MiB/s, done.
Resolving deltas: 100% (166/166), completed with 10 local objects.
$ git fetch --depth 100
remote: Enumerating objects: 6031, done.
remote: Counting objects: 100% (5332/5332), done.
remote: Compressing objects: 100% (4312/4312), done.
remote: Total 5107 (delta 1739), reused 2367 (delta 531)
Receiving objects: 100% (5107/5107), 208.07 MiB | 14.61 MiB/s, done.
Resolving deltas: 100% (1739/1739), completed with 120 local objects.
$ git fetch
$ git pull origin master

cloneの場合も同様。

1
$ git clone --depth 1 http://example.com/fuga.git