25

I am unable to git clone a remote repository using plain

git clone path 

I get the error "The remote end hung up unexpectedly". The complete msg I get is :

Cloning into 'xyzabc'...
remote: Counting objects: 4328, done.
remote: Compressing objects: 100% (3861/3861), done.
select: Not enough memory2192/4328), 123.71 MiB | 164.00 KiB/s
ffatal: The remote end hung up unexpectedly
atal: early EOF
fatal: index-pack failed

I search online for a solution and after trying every other solution landed on solution of doing :

git clone --depth=1 path

followed by

git fetch --unshallow

Now the clone is completing fully. But, when I try to run git fetch --unshallow to recieve the complete project, I get the error :

fatal: --unshallow on a complete repository does not make sense

I dont know what to do please guide

Rohit Rane
  • 2,790
  • 6
  • 25
  • 41

6 Answers6

12

I too found the same message. Looks like it's not allowing to unshallow a shallow clone. You might want to try.

git fetch --depth=10000

assuming there are 10000 depths in your clone.

Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
11

git fetch --depth=10000 remains necessary, but at least you now have a way to confirm your repo is unshallow or not with Git 2.14.x/2.15, Q4 2017.

See commit 417abfd (18 Sep 2017) by Øystein Walle (``).
(Merged by Junio C Hamano -- gitster -- in commit 3430fff, 25 Sep 2017)

rev-parse: rev-parse: add --is-shallow-repository

"git rev-parse" learned "--is-shallow-repository", that is to be used in a way similar to existing "--is-bare-repository" and friends.

Running git fetch --unshallow on a repo that is not in fact shallow produces a fatal error message.
Add a helper to rev-parse that scripters can use to determine whether a repo is shallow or not.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
7

For Azure DevOps Build Pipelines, you need to go to the build pipelines => Edit => Triggers => YAML => Get sources

enter image description here

Save and re-run the build pipeline

Erick Boshoff
  • 1,443
  • 2
  • 18
  • 30
0

you are missing one step here,

after

git clone --depth=1 path

after this cd into your project directory,

cd <intoPartiallyClonedProject>

then,you need to perform git fetch --depth=N, with increasing N like

git fetch --depth=5
git fetch --depth=200
git fetch --depth=500
git fetch --depth=1000

and then perform

this is best explained in detail in this answer,

answer by me i.e NikhilP

error: RPC failed; curl transfer closed with outstanding read data remaining

upvote if it helps you.

NikhilP
  • 1,508
  • 14
  • 23
0

Configurations that helped with the error is (In GitLab)

For each project :

  1. On the top bar, select Main menu > Projects and find your project.
  2. On the left sidebar, select Settings > CI/CD. Expand General pipelines.
  3. Under Git strategy, choose git fetch, under Git shallow clone, enter a value, 1000, the maximum value for GIT_DEPTH Read More - https://gitlab.yourcompany.com/help/ci/pipelines/settings#limit-the-number-of-changes-fetched-during-clone{}

In the .gitlab-ci-yml (this should be done before any command that calls GitVersion.exe)

  before_script:
    - git fetch --prune --tags --unshallow  
crakama
  • 759
  • 11
  • 25
-4

This message means you have already unshallowed your repository.

cmicat
  • 347
  • 3
  • 5