Data after a batch of git

Source: Internet
Author: User
Tags gopher

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


$ git config http.postbuffer 524288000

The global settings can be:

$ git config--global http.postbuffer 524288000

Include in the. git/config file
Postbuffer = 524288000


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.




Data after a batch of git

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.