3

次のコマンドを (Windows コマンド プロンプトで) 実行して、git リポジトリのクローンを作成しようとしています。

git clone --branch=master --no-checkout --depth=2 --progress -v http://mygitserver.com/myrepo.git C:\Dev

ただし、進行状況は、次のコマンドまでしか取得できず、ハングすることを示しています。

POST git-upload-pack (165 bytes)

タスクは終了せず、無期限に待機するだけで、進行はありません。

ただし、--depthパラメーターを削除すると、コマンドは期待どおりに完了します。別のリポジトリとブランチでコマンドを試しましたが、同じハングが発生します。

git cloneが指定されているときにコマンドが失敗する理由について、誰か提案--depthがありますか?

それが役立つ場合は、Bonobo Git サーバーを使用して、自己ホスト型の Git サーバーを使用しています。

以下のいくつかのコメントに続いて、いくつかの追加トレースを使用してコマンドを再実行してみました。が設定されている場合--depth=2、最終的な HTTP コマンドに対して以下が返されます...

> 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
<

この時点で、ハングするだけです。

コマンドを指定せずに再実行する--depth=2と、さらに進み、完了します

> 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.

私は実際に GoCD と呼ばれるツールを使用していくつかのコードをデプロイしていることに注意してください。GIT コマンドを発行している GoCD はすぐにハングします。(GITリポジトリを複製するために発行するコマンドを制御できるとは思いません)。自分のマシンでローカルにコマンドを実行すると同じことが起こるため、実際には GoCD の問題ではありません。

4

0 に答える 0