Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e10bbceb36
89 lines (72 sloc) 3.768 kb
INITIAL CLONE
The client connects and sends the request header. The clone command
> git clone git://volcano/mojombo/god.git
produces the following request:
0032git-upload-pack /mojombo/god.git\000host=volcano\000
The first four bytes contain the hex length of the line (including 4 byte line
length and trailing newline if present). Following are the command and
arguments. This is followed by a null byte and then the host information. The
request is terminated by a null byte.
The request is processed and turned into a call to git-upload-pack:
> git-upload-pack /path/to/repos/mojombo/god.git
This immediately returns information of the repo:
007c74730d410fcb6603ace96f1dc55ea6196122532d HEAD\000multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress
003e15f0ceeef36e49eb51d6efcc7ed4df7b6a03d14f refs/heads/Bertg
003e7d1665144a3a975c05f1f43902ddaf084e784dbe refs/heads/debug
003f60487cc2182dd3f0fbc841d7f45afc61ef18ffc5 refs/heads/debug2
003d5a3f6be755bbb7deae50065988cbfa1ffa9ab68a refs/heads/dist
003e7e47fe2bd8d01d481f44d7af0531bd93d3b21c01 refs/heads/local
003f74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/master
0000
Each line starts with a four byte line length declaration in hex. The section
is terminated by a line length declaration of 0000.
This is sent back to the client verbatim. The client responds with another
request:
0054want 74730d410fcb6603ace96f1dc55ea6196122532d multi_ack side-band-64k ofs-delta
0032want 15f0ceeef36e49eb51d6efcc7ed4df7b6a03d14f
0032want 7d1665144a3a975c05f1f43902ddaf084e784dbe
0032want 60487cc2182dd3f0fbc841d7f45afc61ef18ffc5
0032want 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a
0032want 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01
0032want 74730d410fcb6603ace96f1dc55ea6196122532d
00000009done
The is sent to the open git-upload-pack process which then streams out the
final response:
"0008NAK\n"
"0023\002Counting objects: 2797, done.\n"
"002b\002Compressing objects: 0% (1/1177) \r"
"002c\002Compressing objects: 1% (12/1177) \r"
"002c\002Compressing objects: 2% (24/1177) \r"
"002c\002Compressing objects: 3% (36/1177) \r"
"002c\002Compressing objects: 4% (48/1177) \r"
"002c\002Compressing objects: 5% (59/1177) \r"
"002c\002Compressing objects: 6% (71/1177) \r"
"0053\002Compressing objects: 7% (83/1177) \rCompressing objects: 8% (95/1177) \r"
...
"005b\002Compressing objects: 100% (1177/1177) \rCompressing objects: 100% (1177/1177), done.\n"
"2004\001PACK\000\000\000\002\000\000\n\355\225\017x\234\235\216K\n\302"..."\b<M^*\343\362\302s"
"2005\001\360\204{\225\376\330\345]z\226\273"..."\361\326\245\036\036\334*78w)\327\"/"
...
"0037\002Total 2797 (delta 1799), reused 2360 (delta 1529)\n"
...
"<\276\255L\273s\005\001w0006\001[0000"
UPDATE
005ewant 1814e8d67376c467ea221f5ed290957fac61cbfc multi_ack side-band-64k thin-pack ofs-delta\n
00000032have 74730d410fcb6603ace96f1dc55ea6196122532d\n
0032have 09c409e182256ed9505febccaf323c99b43c55df\n
0032have d68a13199d99cecc663ad0dda5e24455f3628b65\n
0032have b3b55b5794e816d1b20e7a6908551f2430d7403f\n
0032have 4f12e1ceb12a9da7444a4de3572b3288f623276b\n
0032have 57bd329169794773b962e631d239cf3c8a3ed9de\n
0032have 4bd501221b1568d769d900f60d36d6c0b264350b\n
0032have ba98fdce987aa50fe840a2cafd5f1f4e6e0815aa\n
0032have 582fca91f5dde41339522299835639d82d10a576\n
0032have 466dbc3416c15c7f968f3012aa23904e157ad50f\n
0032have 87c194332a77399b96efec701a242a0df16778d8\n
0032have 15f0ceeef36e49eb51d6efcc7ed4df7b6a03d14f\n
0032have b69311d226b8569c27f2e0ed641f59eb7b018d1a\n
0032have 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a\n
0032have 60487cc2182dd3f0fbc841d7f45afc61ef18ffc5\n
0032have 7d1665144a3a975c05f1f43902ddaf084e784dbe\n
0032have 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01\n
0009done
Jump to Line
Something went wrong with that request. Please try again.