I am trying to run the following command (in a Windows command prompt) to clone a git repository
git clone --branch=master --no-checkout --depth=2 --progress -v http://mygitserver.com/myrepo.git C:\Dev
However, the progress shows it only gets as far as the following command, then it just hangs:
POST git-upload-pack (165 bytes)
The task does not end, it just waits indefinitely, and no progress is made.
However, if I remove the --depth
parameter, then the command completes as expected. I've tried the command on a different repository and branch, but the same hanging occurs.
Does anyone have any suggestion as to why the git clone
command is failing when --depth
is specified?
If it helps, we are using a self-hosted Git server, using Bonobo Git Server.
Following on from some comments below, I tried re-running the commands with some extra traces. In the case when --depth=2
is set, the following is return for the final HTTP command...
> POST /MyRepo.git/git-upload-pack HTTP/1.1
Host: mygitserver.com
Authorization: Basic xxxxxxxxxxxxxxxxxxxx
User-Agent: git/2.9.0.windows.1
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 165
* upload completely sent off: 165 out of 165 bytes
< HTTP/1.1 200 OK
< Cache-Control: no-cache, max-age=0, must-revalidate
< Pragma: no-cache
< Transfer-Encoding: chunked
< Content-Type: application/x-git-upload-pack-result
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Server: Microsoft-IIS/7.5
< X-AspNetMvc-Version: 4.0
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Sat, 18 Jun 2016 14:11:01 GMT
<
At this point, it just hangs.
When I re-run the command without --depth=2
specified, it gets further, and completes
> POST /MyRepo.git/git-upload-pack HTTP/1.1
Host: mygitserver.com
Authorization: Basic xxxxxxxxxxxxxxxxxxxx
User-Agent: git/2.9.0.windows.1
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 200
* upload completely sent off: 200 out of 200 bytes
< HTTP/1.1 200 OK
< Cache-Control: no-cache, max-age=0, must-revalidate
< Pragma: no-cache
< Transfer-Encoding: chunked
< Content-Type: application/x-git-upload-pack-result
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Server: Microsoft-IIS/7.5
< X-AspNetMvc-Version: 4.0
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Sat, 18 Jun 2016 14:15:28 GMT
<
remote: Counting objects: 442, done.
remote: Compressing objects: 100% (440/440), done.
15:15:32.096147 run-command.c:336 trace: run_command: 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 5180 on MyLaptop' '--check-self-contained-and-connected' '--pack_header=2,442'
15:15:32.158649 git.c:350 trace: built-in: git 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 5180 on MyLaptop' '--check-self-contained-and-connected' '--pack_header=2,442'
* Connection #1 to host mygitserver.com left intact
remote: Total 442 (delta 321), reused 0 (delta 0)
Receiving objects: 100% (442/442), 6.08 MiB | 431.00 KiB/s, done.
Resolving deltas: 100% (321/321), done.
Checking connectivity... 15:15:49.340288 run-command.c:336 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all'
15:15:49.434038 git.c:350 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all'
done.
Note that I am actually using a tool called GoCD to deploy some code, and it GoCD that is issuing the GIT command, the promptly hanging. (I don't think I have any control over what command it issues to clone the GIT repo). The same thing happens when I run the command locally on my machine, so it is not actually an issue with GoCD though.