Created
June 10, 2024 05:02
-
-
Save jimdiroffii/0b878bbd59008f9f5938687dd2a2cc76 to your computer and use it in GitHub Desktop.
Fix "Fatal: early EOF" clone issue with large git repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit: ingyhere | https://stackoverflow.com/a/22317479/8077665 | |
# Fixes this error during `git clone` | |
# | |
# fetch-pack: unexpected disconnect while reading sideband packet | |
# fatal: early EOF | |
# fatal: fetch-pack: invalid index-pack output | |
# | |
# 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 that works, go into the new git directory and retrieve the rest of the clone: | |
git fetch --unshallow | |
# if unshallow fails, alternately, fetch a max (2147483647) depth or series (1,2,3,4,..,n) of depths | |
git fetch --depth=2 | |
git fetch --depth=2147483647 | |
# Now, do a regular pull: | |
git pull --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment