Skip to content

Commit a31409a

Browse files
roifenetworm
authored andcommitted
update transfer-protocols.asc
1 parent 2a51625 commit a31409a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

book/10-git-internals/sections/transfer-protocols.asc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ $ ssh -x git@server "git-receive-pack 'simplegit-progit.git'"
175175
这里的全为 '0' 的 SHA-1 值表示之前没有过这个引用——因为你正要添加新的 experiment 引用。
176176
删除引用时,将会看到相反的情况:右边的 SHA-1 值全为 '0'。
177177

178+
然后,客户端会发送一个包含了所有服务端上所没有的对象的包文件。
179+
最终,服务端会响应一个成功(或失败)的标识。
180+
181+
[source]
182+
----
183+
000eunpack ok
184+
----
185+
186+
====== HTTP(S)
187+
188+
上传过程在 HTTP 上几乎是相同的,除了握手阶段有一点小区别。
178189
连接是从下面这个请求开始的:
179190

180191
[source]
@@ -198,6 +209,8 @@ $ ssh -x git@server "git-receive-pack 'simplegit-progit.git'"
198209
这个 `POST` 请求的内容是 `send-pack` 的输出和相应的包文件。
199210
服务端在收到请求后相应地作出成功或失败的 HTTP 响应。
200211

212+
请牢记,HTTP 协议有可能会进一步用分块传输编码将数据包裹起来。
213+
201214
===== 下载数据
202215

203216
(((git commands, fetch-pack)))(((git commands, upload-pack)))

0 commit comments

Comments
 (0)