Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git clone fatal

Tags:

git

git-clone

I am getting error while doing git clone.

fatal: pack has bad object at offset 824775943: inflate returned 1
fatal: index-pack failed

It is coming only on windows 10, on linux git clone is working fine

like image 601
Lakshay Awasthi Avatar asked Dec 23 '22 22:12

Lakshay Awasthi


1 Answers

Here are the two main causes of a fatal error.

1. Slow Internet connection

Cause of error: The repository is huge and Internet connection is simply too slow.

Solution: Changing to a faster and more stable Internet Connection Help.

2. Huge repository

Cause of error: The repository you are trying to clone is large, in terms of file size. While attempting to clone it, the remote server simply doesn’t have enough memory to cope with the execution.

Solution:

Turn of compression. Git clone partially. When it is successful, clone the rest.

1) First, turn off Git compression.

git config --global core.compression 0

2) Then do a partial clone of the repository with --depth 1 parameter. Replace [email protected]/path/to/git_repo/ with the actual path to the repository.

git clone --depth 1 ssh://[email protected]/path/to/git_repo/

3) Next, retrieve the rest of the repository.

git fetch --unshallow

4) Finally, finish it up with a regular pull.

git pull --all

These methods solved my problem. Hope it helps!

like image 107
MangduYogii Avatar answered Dec 29 '22 01:12

MangduYogii