If a large file is involved in a git transfer, we may receive the following error:
Sourcetree's error.
Command-line error:
$ git clone https://********/gopher.git
Cloning into ' gopher ' ...
Remote:counting objects:275, done.
Remote:compressing objects:100% (234/234), done.
Fatal:the remote end hung up Unexpectedlyb | 87.00 kib/s
Fatal:early EOF
Fatal:index-pack failed
The solutions mentioned online are as follows:
To modify the default Postbuffer size of git
If the file you want to post is larger, you can modify the default postbuffer size of git
Linux
$ git config http.postbuffer 524288000
The global settings can be:
$ git config--global http.postbuffer 524288000
Windows:
Include in the. git/config file
[HTTP]
Postbuffer = 524288000
Http://blog.sina.com.cn/s/blog_71d4414d0100wfwq.html
Download by step
First, turn off compression:
$ git config--global core.compression 0
Next, let's do a partial clone to truncate the amount of info coming down:
$ git clone--depth 1 <repo_URI>
When this works, go into the new directory and retrieve the rest of the clone:
$ git fetch--unshallow
Or, alternately,
$ git fetch--depth=2147483647
Now, does a regular pull:
$ git pull--all
I think there is a glitch with Msysgit on the 1.8.x versions that exacerbates these symptoms, so another option was to try With an earlier version of Git (<= 1.8.3, I think).
Of course, Git clone can turn into the following steps:
$ git init
Initialized Empty Git repository in/users/ghj1976/documents/work/wangpos/git/gopher/.git/
$ git Remote add Origin https://******/gopher.git
$ git Pull--depth 1
Remote:counting objects:141, done.
Remote:compressing objects:100% (114/114), done.
Remote:total 141 (Delta 4), reused 0 (Delta 0)
Receiving objects:100% (141/141), 1.68 MiB | 45.00 kib/s, done.
Resolving deltas:100% (4/4), done.
From Https://******/gopher
* [New branch] master, Origin/master
There is no tracking information for the current branch.
Please specify which branch your want to the merge with.
See Git-pull (1) for details.
Git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
Git branch--set-upstream-to=origin/<branch> Master
The key is to use –depth to get the latest update records. This number can be an arbitrary int number.
git clone YOUR_REPO --depth=1git fetch --depth=10...git fetch --depth=100git fetch --unshallow //Downloads all history allowing to push from repo
--depth <depth>
Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository have a number of limitations (you cannot clone or fetch from it, nor push from nor to it), but is ad Equate if you is only interested in the recent history of a large project with a long history, and would want to send in Fixes as patches.
Resources:
Http://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed
Http://stackoverflow.com/questions/4826639/repack-of-git-repository-fails
Data after a batch of git