2 <html xmlns=
"http://www.w3.org/1999/xhtml" lang=
"en">
4 <meta charset=
"UTF-8"/>
5 <meta http-equiv=
"X-UA-Compatible" content=
"IE=edge"/>
6 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0"/>
7 <meta name=
"generator" content=
"Asciidoctor 2.0.20"/>
8 <title>gitprotocol-http(
5)
</title>
9 <link rel=
"stylesheet" href=
"https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/>
11 /*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
12 /* Uncomment the following line when using as a custom stylesheet */
13 /* @import
"https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */
14 html{font-family:sans-serif;-webkit-text-size-adjust:
100%}
16 a:focus{outline:thin dotted}
17 a:active,a:hover{outline:
0}
18 h1{font-size:
2em;margin:
.67em
0}
19 b,strong{font-weight:bold}
21 abbr[title]{cursor:help;border-bottom:
1px dotted #dddddf;text-decoration:none}
22 dfn{font-style:italic}
24 mark{background:#ff0;color:#
000}
25 code,kbd,pre,samp{font-family:monospace;font-size:
1em}
26 pre{white-space:pre-wrap}
27 q{quotes:
"\201C" "\201D" "\2018" "\2019"}
29 sub,sup{font-size:
75%;line-height:
0;position:relative;vertical-align:baseline}
33 svg:not(:root){overflow:hidden}
35 audio,video{display:inline-block}
36 audio:not([controls]){display:none;height:
0}
37 fieldset{border:
1px solid silver;margin:
0 2px;padding:
.35em
.625em
.75em}
38 legend{border:
0;padding:
0}
39 button,input,select,textarea{font-family:inherit;font-size:
100%;margin:
0}
40 button,input{line-height:normal}
41 button,select{text-transform:none}
42 button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
43 button[disabled],html input[disabled]{cursor:default}
44 input[type=checkbox],input[type=radio]{padding:
0}
45 button::-moz-focus-inner,input::-moz-focus-inner{border:
0;padding:
0}
46 textarea{overflow:auto;vertical-align:top}
47 table{border-collapse:collapse;border-spacing:
0}
48 *,::before,::after{box-sizing:border-box}
49 html,body{font-size:
100%}
50 body{background:#fff;color:rgba(
0,
0,
0,
.8);padding:
0;margin:
0;font-family:
"Noto Serif",
"DejaVu Serif",serif;line-height:
1;position:relative;cursor:auto;-moz-tab-size:
4;-o-tab-size:
4;tab-size:
4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
51 a:hover{cursor:pointer}
52 img,object,embed{max-width:
100%;height:auto}
53 object,embed{height:
100%}
54 img{-ms-interpolation-mode:bicubic}
55 .left{float:left!important}
56 .right{float:right!important}
57 .text-left{text-align:left!important}
58 .text-right{text-align:right!important}
59 .text-center{text-align:center!important}
60 .text-justify{text-align:justify!important}
62 img,object,svg{display:inline-block;vertical-align:middle}
63 textarea{height:auto;min-height:
50px}
65 .subheader,.admonitionblock td.content
>.title,.audioblock
>.title,.exampleblock
>.title,.imageblock
>.title,.listingblock
>.title,.literalblock
>.title,.stemblock
>.title,.openblock
>.title,.paragraph
>.title,.quoteblock
>.title,table.tableblock
>.title,.verseblock
>.title,.videoblock
>.title,.dlist
>.title,.olist
>.title,.ulist
>.title,.qlist
>.title,.hdlist
>.title{line-height:
1.45;color:#
7a2518;font-weight:
400;margin-top:
0;margin-bottom:
.25em}
66 div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:
0;padding:
0}
67 a{color:#
2156a5;text-decoration:underline;line-height:inherit}
68 a:hover,a:focus{color:#
1d4b8f}
70 p{line-height:
1.6;margin-bottom:
1.25em;text-rendering:optimizeLegibility}
71 p aside{font-size:
.875em;line-height:
1.35;font-style:italic}
72 h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6{font-family:
"Open Sans",
"DejaVu Sans",sans-serif;font-weight:
300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:
1em;margin-bottom:
.5em;line-height:
1.0125em}
73 h1 small,h2 small,h3 small,#toctitle small,.sidebarblock
>.content
>.title small,h4 small,h5 small,h6 small{font-size:
60%;color:#e99b8f;line-height:
0}
75 h2{font-size:
1.6875em}
76 h3,#toctitle,.sidebarblock
>.content
>.title{font-size:
1.375em}
77 h4,h5{font-size:
1.125em}
79 hr{border:solid #dddddf;border-width:
1px
0 0;clear:both;margin:
1.25em
0 1.1875em}
80 em,i{font-style:italic;line-height:inherit}
81 strong,b{font-weight:bold;line-height:inherit}
82 small{font-size:
60%;line-height:inherit}
83 code{font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;font-weight:
400;color:rgba(
0,
0,
0,
.9)}
84 ul,ol,dl{line-height:
1.6;margin-bottom:
1.25em;list-style-position:outside;font-family:inherit}
85 ul,ol{margin-left:
1.5em}
86 ul li ul,ul li ol{margin-left:
1.25em;margin-bottom:
0}
87 ul.circle{list-style-type:circle}
88 ul.disc{list-style-type:disc}
89 ul.square{list-style-type:square}
90 ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
91 ol li ul,ol li ol{margin-left:
1.25em;margin-bottom:
0}
92 dl dt{margin-bottom:
.3125em;font-weight:bold}
93 dl dd{margin-bottom:
1.25em}
94 blockquote{margin:
0 0 1.25em;padding:
.5625em
1.25em
0 1.1875em;border-left:
1px solid #ddd}
95 blockquote,blockquote p{line-height:
1.6;color:rgba(
0,
0,
0,
.85)}
96 @media screen and (min-width:
768px){h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6{line-height:
1.2}
98 h2{font-size:
2.3125em}
99 h3,#toctitle,.sidebarblock
>.content
>.title{font-size:
1.6875em}
100 h4{font-size:
1.4375em}}
101 table{background:#fff;margin-bottom:
1.25em;border:
1px solid #dedede;word-wrap:normal}
102 table thead,table tfoot{background:#f7f8f7}
103 table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:
.5em
.625em
.625em;font-size:inherit;color:rgba(
0,
0,
0,
.8);text-align:left}
104 table tr th,table tr td{padding:
.5625em
.625em;font-size:inherit;color:rgba(
0,
0,
0,
.8)}
105 table tr.even,table tr.alt{background:#f8f8f7}
106 table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:
1.6}
107 h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6{line-height:
1.2;word-spacing:-
.05em}
108 h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock
>.content
>.title strong,h4 strong,h5 strong,h6 strong{font-weight:
400}
109 .center{margin-left:auto;margin-right:auto}
111 .clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:
" ";display:table}
112 .clearfix::after,.float-group::after{clear:both}
113 :not(pre).nobreak{word-wrap:normal}
114 :not(pre).nowrap{white-space:nowrap}
115 :not(pre).pre-wrap{white-space:pre-wrap}
116 :not(pre):not([class^=L])
>code{font-size:
.9375em;font-style:normal!important;letter-spacing:
0;padding:
.1em
.5ex;word-spacing:-
.15em;background:#f7f7f8;border-radius:
4px;line-height:
1.45;text-rendering:optimizeSpeed}
117 pre{color:rgba(
0,
0,
0,
.9);font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;line-height:
1.45;text-rendering:optimizeSpeed}
118 pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
119 pre
>code{display:block}
120 pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
121 em em{font-style:normal}
122 strong strong{font-weight:
400}
123 .keyseq{color:rgba(
51,
51,
51,
.8)}
124 kbd{font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;display:inline-block;color:rgba(
0,
0,
0,
.8);font-size:
.65em;line-height:
1.45;background:#f7f7f7;border:
1px solid #ccc;border-radius:
3px;box-shadow:
0 1px
0 rgba(
0,
0,
0,
.2),inset
0 0 0 .1em #fff;margin:
0 .15em;padding:
.2em
.5em;vertical-align:middle;position:relative;top:-
.1em;white-space:nowrap}
125 .keyseq kbd:first-child{margin-left:
0}
126 .keyseq kbd:last-child{margin-right:
0}
127 .menuseq,.menuref{color:#
000}
128 .menuseq b:not(.caret),.menuref{font-weight:inherit}
129 .menuseq{word-spacing:-
.02em}
130 .menuseq b.caret{font-size:
1.25em;line-height:
.8}
131 .menuseq i.caret{font-weight:bold;text-align:center;width:
.45em}
132 b.button::before,b.button::after{position:relative;top:-
1px;font-weight:
400}
133 b.button::before{content:
"[";padding:
0 3px
0 2px}
134 b.button::after{content:
"]";padding:
0 2px
0 3px}
135 p a
>code:hover{color:rgba(
0,
0,
0,
.9)}
136 #header,#content,#footnotes,#footer{width:
100%;margin:
0 auto;max-width:
62.5em;*zoom:
1;position:relative;padding-left:
.9375em;padding-right:
.9375em}
137 #header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:
" ";display:table}
138 #header::after,#content::after,#footnotes::after,#footer::after{clear:both}
139 #content{margin-top:
1.25em}
140 #content::before{content:none}
141 #header
>h1:first-child{color:rgba(
0,
0,
0,
.85);margin-top:
2.25rem;margin-bottom:
0}
142 #header
>h1:first-child+#toc{margin-top:
8px;border-top:
1px solid #dddddf}
143 #header
>h1:only-child,body.toc2 #header
>h1:nth-last-child(
2){border-bottom:
1px solid #dddddf;padding-bottom:
8px}
144 #header .details{border-bottom:
1px solid #dddddf;line-height:
1.45;padding-top:
.25em;padding-bottom:
.25em;padding-left:
.25em;color:rgba(
0,
0,
0,
.6);display:flex;flex-flow:row wrap}
145 #header .details span:first-child{margin-left:-
.125em}
146 #header .details span.email a{color:rgba(
0,
0,
0,
.85)}
147 #header .details br{display:none}
148 #header .details br+span::before{content:
"\00a0\2013\00a0"}
149 #header .details br+span.author::before{content:
"\00a0\22c5\00a0";color:rgba(
0,
0,
0,
.85)}
150 #header .details br+span#revremark::before{content:
"\00a0|\00a0"}
151 #header #revnumber{text-transform:capitalize}
152 #header #revnumber::after{content:
"\00a0"}
153 #content
>h1:first-child:not([class]){color:rgba(
0,
0,
0,
.85);border-bottom:
1px solid #dddddf;padding-bottom:
8px;margin-top:
0;padding-top:
1rem;margin-bottom:
1.25rem}
154 #toc{border-bottom:
1px solid #e7e7e9;padding-bottom:
.5em}
155 #toc
>ul{margin-left:
.125em}
156 #toc ul.sectlevel0
>li
>a{font-style:italic}
157 #toc ul.sectlevel0 ul.sectlevel1{margin:
.5em
0}
158 #toc ul{font-family:
"Open Sans",
"DejaVu Sans",sans-serif;list-style-type:none}
159 #toc li{line-height:
1.3334;margin-top:
.3334em}
160 #toc a{text-decoration:none}
161 #toc a:active{text-decoration:underline}
162 #toctitle{color:#
7a2518;font-size:
1.2em}
163 @media screen and (min-width:
768px){#toctitle{font-size:
1.375em}
164 body.toc2{padding-left:
15em;padding-right:
0}
165 #toc.toc2{margin-top:
0!important;background:#f8f8f7;position:fixed;width:
15em;left:
0;top:
0;border-right:
1px solid #e7e7e9;border-top-width:
0!important;border-bottom-width:
0!important;z-index:
1000;padding:
1.25em
1em;height:
100%;overflow:auto}
166 #toc.toc2 #toctitle{margin-top:
0;margin-bottom:
.8rem;font-size:
1.2em}
167 #toc.toc2
>ul{font-size:
.9em;margin-bottom:
0}
168 #toc.toc2 ul ul{margin-left:
0;padding-left:
1em}
169 #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:
0;margin-top:
.5em;margin-bottom:
.5em}
170 body.toc2.toc-right{padding-left:
0;padding-right:
15em}
171 body.toc2.toc-right #toc.toc2{border-right-width:
0;border-left:
1px solid #e7e7e9;left:auto;right:
0}}
172 @media screen and (min-width:
1280px){body.toc2{padding-left:
20em;padding-right:
0}
173 #toc.toc2{width:
20em}
174 #toc.toc2 #toctitle{font-size:
1.375em}
175 #toc.toc2
>ul{font-size:
.95em}
176 #toc.toc2 ul ul{padding-left:
1.25em}
177 body.toc2.toc-right{padding-left:
0;padding-right:
20em}}
178 #content #toc{border:
1px solid #e0e0dc;margin-bottom:
1.25em;padding:
1.25em;background:#f8f8f7;border-radius:
4px}
179 #content #toc
>:first-child{margin-top:
0}
180 #content #toc
>:last-child{margin-bottom:
0}
181 #footer{max-width:none;background:rgba(
0,
0,
0,
.8);padding:
1.25em}
182 #footer-text{color:hsla(
0,
0%,
100%,
.8);line-height:
1.44}
183 #content{margin-bottom:
.625em}
184 .sect1{padding-bottom:
.625em}
185 @media screen and (min-width:
768px){#content{margin-bottom:
1.25em}
186 .sect1{padding-bottom:
1.25em}}
187 .sect1:last-child{padding-bottom:
0}
188 .sect1+.sect1{border-top:
1px solid #e7e7e9}
189 #content h1
>a.anchor,h2
>a.anchor,h3
>a.anchor,#toctitle
>a.anchor,.sidebarblock
>.content
>.title
>a.anchor,h4
>a.anchor,h5
>a.anchor,h6
>a.anchor{position:absolute;z-index:
1001;width:
1.5ex;margin-left:-
1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:
400}
190 #content h1
>a.anchor::before,h2
>a.anchor::before,h3
>a.anchor::before,#toctitle
>a.anchor::before,.sidebarblock
>.content
>.title
>a.anchor::before,h4
>a.anchor::before,h5
>a.anchor::before,h6
>a.anchor::before{content:
"\00A7";font-size:
.85em;display:block;padding-top:
.1em}
191 #content h1:hover
>a.anchor,#content h1
>a.anchor:hover,h2:hover
>a.anchor,h2
>a.anchor:hover,h3:hover
>a.anchor,#toctitle:hover
>a.anchor,.sidebarblock
>.content
>.title:hover
>a.anchor,h3
>a.anchor:hover,#toctitle
>a.anchor:hover,.sidebarblock
>.content
>.title
>a.anchor:hover,h4:hover
>a.anchor,h4
>a.anchor:hover,h5:hover
>a.anchor,h5
>a.anchor:hover,h6:hover
>a.anchor,h6
>a.anchor:hover{visibility:visible}
192 #content h1
>a.link,h2
>a.link,h3
>a.link,#toctitle
>a.link,.sidebarblock
>.content
>.title
>a.link,h4
>a.link,h5
>a.link,h6
>a.link{color:#ba3925;text-decoration:none}
193 #content h1
>a.link:hover,h2
>a.link:hover,h3
>a.link:hover,#toctitle
>a.link:hover,.sidebarblock
>.content
>.title
>a.link:hover,h4
>a.link:hover,h5
>a.link:hover,h6
>a.link:hover{color:#a53221}
194 details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:
1.25em}
195 details{margin-left:
1.25rem}
196 details
>summary{cursor:pointer;display:block;position:relative;line-height:
1.6;margin-bottom:
.625rem;outline:none;-webkit-tap-highlight-color:transparent}
197 details
>summary::-webkit-details-marker{display:none}
198 details
>summary::before{content:
"";border:solid transparent;border-left:solid;border-width:
.3em
0 .3em
.5em;position:absolute;top:
.5em;left:-
1.25rem;transform:translateX(
15%)}
199 details[open]
>summary::before{border:solid transparent;border-top:solid;border-width:
.5em
.3em
0;transform:translateY(
15%)}
200 details
>summary::after{content:
"";width:
1.25rem;height:
1em;position:absolute;top:
.3em;left:-
1.25rem}
201 .admonitionblock td.content
>.title,.audioblock
>.title,.exampleblock
>.title,.imageblock
>.title,.listingblock
>.title,.literalblock
>.title,.stemblock
>.title,.openblock
>.title,.paragraph
>.title,.quoteblock
>.title,table.tableblock
>.title,.verseblock
>.title,.videoblock
>.title,.dlist
>.title,.olist
>.title,.ulist
>.title,.qlist
>.title,.hdlist
>.title{text-rendering:optimizeLegibility;text-align:left;font-family:
"Noto Serif",
"DejaVu Serif",serif;font-size:
1rem;font-style:italic}
202 table.tableblock.fit-content
>caption.title{white-space:nowrap;width:
0}
203 .paragraph.lead
>p,#preamble
>.sectionbody
>[class=paragraph]:first-of-type p{font-size:
1.21875em;line-height:
1.6;color:rgba(
0,
0,
0,
.85)}
204 .admonitionblock
>table{border-collapse:separate;border:
0;background:none;width:
100%}
205 .admonitionblock
>table td.icon{text-align:center;width:
80px}
206 .admonitionblock
>table td.icon img{max-width:none}
207 .admonitionblock
>table td.icon .title{font-weight:bold;font-family:
"Open Sans",
"DejaVu Sans",sans-serif;text-transform:uppercase}
208 .admonitionblock
>table td.content{padding-left:
1.125em;padding-right:
1.25em;border-left:
1px solid #dddddf;color:rgba(
0,
0,
0,
.6);word-wrap:anywhere}
209 .admonitionblock
>table td.content
>:last-child
>:last-child{margin-bottom:
0}
210 .exampleblock
>.content{border:
1px solid #e6e6e6;margin-bottom:
1.25em;padding:
1.25em;background:#fff;border-radius:
4px}
211 .sidebarblock{border:
1px solid #dbdbd6;margin-bottom:
1.25em;padding:
1.25em;background:#f3f3f2;border-radius:
4px}
212 .sidebarblock
>.content
>.title{color:#
7a2518;margin-top:
0;text-align:center}
213 .exampleblock
>.content
>:first-child,.sidebarblock
>.content
>:first-child{margin-top:
0}
214 .exampleblock
>.content
>:last-child,.exampleblock
>.content
>:last-child
>:last-child,.exampleblock
>.content .olist
>ol
>li:last-child
>:last-child,.exampleblock
>.content .ulist
>ul
>li:last-child
>:last-child,.exampleblock
>.content .qlist
>ol
>li:last-child
>:last-child,.sidebarblock
>.content
>:last-child,.sidebarblock
>.content
>:last-child
>:last-child,.sidebarblock
>.content .olist
>ol
>li:last-child
>:last-child,.sidebarblock
>.content .ulist
>ul
>li:last-child
>:last-child,.sidebarblock
>.content .qlist
>ol
>li:last-child
>:last-child{margin-bottom:
0}
215 .literalblock pre,.listingblock
>.content
>pre{border-radius:
4px;overflow-x:auto;padding:
1em;font-size:
.8125em}
216 @media screen and (min-width:
768px){.literalblock pre,.listingblock
>.content
>pre{font-size:
.90625em}}
217 @media screen and (min-width:
1280px){.literalblock pre,.listingblock
>.content
>pre{font-size:
1em}}
218 .literalblock pre,.listingblock
>.content
>pre:not(.highlight),.listingblock
>.content
>pre[class=highlight],.listingblock
>.content
>pre[class^=
"highlight "]{background:#f7f7f8}
219 .literalblock.output pre{color:#f7f7f8;background:rgba(
0,
0,
0,
.9)}
220 .listingblock
>.content{position:relative}
221 .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:
.75em;top:
.425rem;right:
.5rem;line-height:
1;text-transform:uppercase;color:inherit;opacity:
.5}
222 .listingblock:hover code[data-lang]::before{display:block}
223 .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:
.5em;color:inherit;opacity:
.5}
224 .listingblock.terminal pre .command:not([data-prompt])::before{content:
"$"}
225 .listingblock pre.highlightjs{padding:
0}
226 .listingblock pre.highlightjs
>code{padding:
1em;border-radius:
4px}
227 .listingblock pre.prettyprint{border-width:
0}
228 .prettyprint{background:#f7f7f8}
229 pre.prettyprint .linenums{line-height:
1.45;margin-left:
2em}
230 pre.prettyprint li{background:none;list-style-type:inherit;padding-left:
0}
231 pre.prettyprint li code[data-lang]::before{opacity:
1}
232 pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
233 table.linenotable{border-collapse:separate;border:
0;margin-bottom:
0;background:none}
234 table.linenotable td[class]{color:inherit;vertical-align:top;padding:
0;line-height:inherit;white-space:normal}
235 table.linenotable td.code{padding-left:
.75em}
236 table.linenotable td.linenos,pre.pygments .linenos{border-right:
1px solid;opacity:
.35;padding-right:
.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
237 pre.pygments span.linenos{display:inline-block;margin-right:
.75em}
238 .quoteblock{margin:
0 1em
1.25em
1.5em;display:table}
239 .quoteblock:not(.excerpt)
>.title{margin-left:-
1.5em;margin-bottom:
.75em}
240 .quoteblock blockquote,.quoteblock p{color:rgba(
0,
0,
0,
.85);font-size:
1.15rem;line-height:
1.75;word-spacing:
.1em;letter-spacing:
0;font-style:italic;text-align:justify}
241 .quoteblock blockquote{margin:
0;padding:
0;border:
0}
242 .quoteblock blockquote::before{content:
"\201c";float:left;font-size:
2.75em;font-weight:bold;line-height:
.6em;margin-left:-
.6em;color:#
7a2518;text-shadow:
0 1px
2px rgba(
0,
0,
0,
.1)}
243 .quoteblock blockquote
>.paragraph:last-child p{margin-bottom:
0}
244 .quoteblock .attribution{margin-top:
.75em;margin-right:
.5ex;text-align:right}
245 .verseblock{margin:
0 1em
1.25em}
246 .verseblock pre{font-family:
"Open Sans",
"DejaVu Sans",sans-serif;font-size:
1.15rem;color:rgba(
0,
0,
0,
.85);font-weight:
300;text-rendering:optimizeLegibility}
247 .verseblock pre strong{font-weight:
400}
248 .verseblock .attribution{margin-top:
1.25rem;margin-left:
.5ex}
249 .quoteblock .attribution,.verseblock .attribution{font-size:
.9375em;line-height:
1.45;font-style:italic}
250 .quoteblock .attribution br,.verseblock .attribution br{display:none}
251 .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-
.025em;color:rgba(
0,
0,
0,
.6)}
252 .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
253 .quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:
1.6;word-spacing:
0}
254 .quoteblock.abstract{margin:
0 1em
1.25em;display:block}
255 .quoteblock.abstract
>.title{margin:
0 0 .375em;font-size:
1.15em;text-align:center}
256 .quoteblock.excerpt
>blockquote,.quoteblock .quoteblock{padding:
0 0 .25em
1em;border-left:
.25em solid #dddddf}
257 .quoteblock.excerpt,.quoteblock .quoteblock{margin-left:
0}
258 .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:
1.0625rem}
259 .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:
.85rem;text-align:left;margin-right:
0}
260 p.tableblock:last-child{margin-bottom:
0}
261 td.tableblock
>.content{margin-bottom:
1.25em;word-wrap:anywhere}
262 td.tableblock
>.content
>:last-child{margin-bottom:-
1.25em}
263 table.tableblock,th.tableblock,td.tableblock{border:
0 solid #dedede}
264 table.grid-all
>*
>tr
>*{border-width:
1px}
265 table.grid-cols
>*
>tr
>*{border-width:
0 1px}
266 table.grid-rows
>*
>tr
>*{border-width:
1px
0}
267 table.frame-all{border-width:
1px}
268 table.frame-ends{border-width:
1px
0}
269 table.frame-sides{border-width:
0 1px}
270 table.frame-none
>colgroup+*
>:first-child
>*,table.frame-sides
>colgroup+*
>:first-child
>*{border-top-width:
0}
271 table.frame-none
>:last-child
>:last-child
>*,table.frame-sides
>:last-child
>:last-child
>*{border-bottom-width:
0}
272 table.frame-none
>*
>tr
>:first-child,table.frame-ends
>*
>tr
>:first-child{border-left-width:
0}
273 table.frame-none
>*
>tr
>:last-child,table.frame-ends
>*
>tr
>:last-child{border-right-width:
0}
274 table.stripes-all
>*
>tr,table.stripes-odd
>*
>tr:nth-of-type(odd),table.stripes-even
>*
>tr:nth-of-type(even),table.stripes-hover
>*
>tr:hover{background:#f8f8f7}
275 th.halign-left,td.halign-left{text-align:left}
276 th.halign-right,td.halign-right{text-align:right}
277 th.halign-center,td.halign-center{text-align:center}
278 th.valign-top,td.valign-top{vertical-align:top}
279 th.valign-bottom,td.valign-bottom{vertical-align:bottom}
280 th.valign-middle,td.valign-middle{vertical-align:middle}
281 table thead th,table tfoot th{font-weight:bold}
282 tbody tr th{background:#f7f8f7}
283 tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(
0,
0,
0,
.8);font-weight:bold}
284 p.tableblock
>code:only-child{background:none;padding:
0}
285 p.tableblock{font-size:
1em}
286 ol{margin-left:
1.75em}
287 ul li ol{margin-left:
1.5em}
288 dl dd{margin-left:
1.125em}
289 dl dd:last-child,dl dd:last-child
>:last-child{margin-bottom:
0}
290 li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:
.625em}
291 ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
292 ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:
.625em}
293 ul.unstyled,ol.unstyled{margin-left:
0}
294 li
>p:empty:only-child::before{content:
"";display:inline-block}
295 ul.checklist
>li
>p:first-child{margin-left:-
1em}
296 ul.checklist
>li
>p:first-child
>.fa-square-o:first-child,ul.checklist
>li
>p:first-child
>.fa-check-square-o:first-child{width:
1.25em;font-size:
.8em;position:relative;bottom:
.125em}
297 ul.checklist
>li
>p:first-child
>input[type=checkbox]:first-child{margin-right:
.25em}
298 ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:
0 0 .625em -
1.25em}
299 ul.inline
>li{margin-left:
1.25em}
300 .unstyled dl dt{font-weight:
400;font-style:normal}
301 ol.arabic{list-style-type:decimal}
302 ol.decimal{list-style-type:decimal-leading-zero}
303 ol.loweralpha{list-style-type:lower-alpha}
304 ol.upperalpha{list-style-type:upper-alpha}
305 ol.lowerroman{list-style-type:lower-roman}
306 ol.upperroman{list-style-type:upper-roman}
307 ol.lowergreek{list-style-type:lower-greek}
308 .hdlist
>table,.colist
>table{border:
0;background:none}
309 .hdlist
>table
>tbody
>tr,.colist
>table
>tbody
>tr{background:none}
310 td.hdlist1,td.hdlist2{vertical-align:top;padding:
0 .625em}
311 td.hdlist1{font-weight:bold;padding-bottom:
1.25em}
312 td.hdlist2{word-wrap:anywhere}
313 .literalblock+.colist,.listingblock+.colist{margin-top:-
.5em}
314 .colist td:not([class]):first-child{padding:
.4em
.75em
0;line-height:
1;vertical-align:top}
315 .colist td:not([class]):first-child img{max-width:none}
316 .colist td:not([class]):last-child{padding:
.25em
0}
317 .thumb,.th{line-height:
0;display:inline-block;border:
4px solid #fff;box-shadow:
0 0 0 1px #ddd}
318 .imageblock.left{margin:
.25em
.625em
1.25em
0}
319 .imageblock.right{margin:
.25em
0 1.25em
.625em}
320 .imageblock
>.title{margin-bottom:
0}
321 .imageblock.thumb,.imageblock.th{border-width:
6px}
322 .imageblock.thumb
>.title,.imageblock.th
>.title{padding:
0 .125em}
323 .image.left,.image.right{margin-top:
.25em;margin-bottom:
.25em;display:inline-block;line-height:
0}
324 .image.left{margin-right:
.625em}
325 .image.right{margin-left:
.625em}
326 a.image{text-decoration:none;display:inline-block}
327 a.image object{pointer-events:none}
328 sup.footnote,sup.footnoteref{font-size:
.875em;position:static;vertical-align:super}
329 sup.footnote a,sup.footnoteref a{text-decoration:none}
330 sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
331 #footnotes{padding-top:
.75em;padding-bottom:
.75em;margin-bottom:
.625em}
332 #footnotes hr{width:
20%;min-width:
6.25em;margin:-
.25em
0 .75em;border-width:
1px
0 0}
333 #footnotes .footnote{padding:
0 .375em
0 .225em;line-height:
1.3334;font-size:
.875em;margin-left:
1.2em;margin-bottom:
.2em}
334 #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-
1.05em}
335 #footnotes .footnote:last-of-type{margin-bottom:
0}
336 #content #footnotes{margin-top:-
.625em;margin-bottom:
0;padding:
.75em
0}
337 div.unbreakable{page-break-inside:avoid}
338 .big{font-size:larger}
339 .small{font-size:smaller}
340 .underline{text-decoration:underline}
341 .overline{text-decoration:overline}
342 .line-through{text-decoration:line-through}
344 .aqua-background{background:#
00fafa}
346 .black-background{background:#
000}
348 .blue-background{background:#
0000fa}
349 .fuchsia{color:#bf00bf}
350 .fuchsia-background{background:#fa00fa}
352 .gray-background{background:#
7d7d7d}
353 .green{color:#
006000}
354 .green-background{background:#
007d00}
356 .lime-background{background:#
00fa00}
357 .maroon{color:#
600000}
358 .maroon-background{background:#
7d0000}
360 .navy-background{background:#
00007d}
361 .olive{color:#
606000}
362 .olive-background{background:#
7d7d00}
363 .purple{color:#
600060}
364 .purple-background{background:#
7d007d}
366 .red-background{background:#fa0000}
367 .silver{color:#
909090}
368 .silver-background{background:#bcbcbc}
370 .teal-background{background:#
007d7d}
371 .white{color:#bfbfbf}
372 .white-background{background:#fafafa}
373 .yellow{color:#bfbf00}
374 .yellow-background{background:#fafa00}
375 span.icon
>.fa{cursor:default}
376 a span.icon
>.fa{cursor:inherit}
377 .admonitionblock td.icon [class^=
"fa icon-"]{font-size:
2.5em;text-shadow:
1px
1px
2px rgba(
0,
0,
0,
.5);cursor:default}
378 .admonitionblock td.icon .icon-note::before{content:
"\f05a";color:#
19407c}
379 .admonitionblock td.icon .icon-tip::before{content:
"\f0eb";text-shadow:
1px
1px
2px rgba(
155,
155,
0,
.8);color:#
111}
380 .admonitionblock td.icon .icon-warning::before{content:
"\f071";color:#bf6900}
381 .admonitionblock td.icon .icon-caution::before{content:
"\f06d";color:#bf3400}
382 .admonitionblock td.icon .icon-important::before{content:
"\f06a";color:#bf0000}
383 .conum[data-value]{display:inline-block;color:#fff!important;background:rgba(
0,
0,
0,
.8);border-radius:
50%;text-align:center;font-size:
.75em;width:
1.67em;height:
1.67em;line-height:
1.67em;font-family:
"Open Sans",
"DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
384 .conum[data-value] *{color:#fff!important}
385 .conum[data-value]+b{display:none}
386 .conum[data-value]::after{content:attr(data-value)}
387 pre .conum[data-value]{position:relative;top:-
.125em}
388 b.conum *{color:inherit!important}
389 .conum:not([data-value]):empty{display:none}
390 dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
391 h1,h2,p,td.content,span.alt,summary{letter-spacing:-
.01em}
392 p strong,td.content strong,div.footnote strong{letter-spacing:-
.005em}
393 p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:
1.0625rem}
394 p{margin-bottom:
1.25rem}
395 .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:
1em}
396 .exampleblock
>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:
0 1px
4px #e0e0dc}
397 .print-only{display:none!important}
398 @page{margin:
1.25cm
.75cm}
399 @media print{*{box-shadow:none!important;text-shadow:none!important}
401 a{color:inherit!important;text-decoration:underline!important}
402 a.bare,a[href^=
"#"],a[href^=
"mailto:"]{text-decoration:none!important}
403 a[href^=
"http:"]:not(.bare)::after,a[href^=
"https:"]:not(.bare)::after{content:
"(" attr(href)
")";display:inline-block;font-size:
.875em;padding-left:
.25em}
404 abbr[title]{border-bottom:
1px dotted}
405 abbr[title]::after{content:
" (" attr(title)
")"}
406 pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
407 thead{display:table-header-group}
409 p,blockquote,dt,td.content{font-size:
1em;orphans:
3;widows:
3}
410 h2,h3,#toctitle,.sidebarblock
>.content
>.title{page-break-after:avoid}
411 #header,#content,#footnotes,#footer{max-width:none}
412 #toc,.sidebarblock,.exampleblock
>.content{background:none!important}
413 #toc{border-bottom:
1px solid #dddddf!important;padding-bottom:
0!important}
414 body.book #header{text-align:center}
415 body.book #header
>h1:first-child{border:
0!important;margin:
2.5em
0 1em}
416 body.book #header .details{border:
0!important;display:block;padding:
0!important}
417 body.book #header .details span:first-child{margin-left:
0!important}
418 body.book #header .details br{display:block}
419 body.book #header .details br+span::before{content:none!important}
420 body.book #toc{border:
0!important;text-align:left!important;padding:
0!important;margin:
0!important}
421 body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1
>h2{page-break-before:always}
422 .listingblock code[data-lang]::before{display:block}
423 #footer{padding:
0 .9375em}
424 .hide-on-print{display:none!important}
425 .print-only{display:block!important}
426 .hide-for-print{display:none!important}
427 .show-for-print{display:inherit!important}}
428 @media amzn-kf8,print{#header
>h1:first-child{margin-top:
1.25rem}
429 .sect1{padding:
0!important}
430 .sect1+.sect1{border:
0}
431 #footer{background:none}
432 #footer-text{color:rgba(
0,
0,
0,
.6);font-size:
.9em}}
433 @media amzn-kf8{#header,#content,#footnotes,#footer{padding:
0}}
441 <body class=
"manpage">
443 <h1>gitprotocol-http(
5) Manual Page
</h1>
444 <h2 id=
"_name">NAME
</h2>
445 <div class=
"sectionbody">
446 <p>gitprotocol-http - Git HTTP-based protocols
</p>
451 <h2 id=
"_synopsis">SYNOPSIS
</h2>
452 <div class=
"sectionbody">
453 <div class=
"verseblock">
454 <pre class=
"content"><over-the-wire-protocol
></pre>
459 <h2 id=
"_description">DESCRIPTION
</h2>
460 <div class=
"sectionbody">
461 <div class=
"paragraph">
462 <p>Git supports two HTTP based transfer protocols. A
"dumb" protocol
463 which requires only a standard HTTP server on the server end of the
464 connection, and a
"smart" protocol which requires a Git aware CGI
465 (or server module). This document describes both protocols.
</p>
467 <div class=
"paragraph">
468 <p>As a design feature smart clients can automatically upgrade
"dumb"
469 protocol URLs to smart URLs. This permits all users to have the
470 same published URL, and the peers automatically select the most
471 efficient transport available to them.
</p>
476 <h2 id=
"_url_format">URL Format
</h2>
477 <div class=
"sectionbody">
478 <div class=
"paragraph">
479 <p>URLs for Git repositories accessed by HTTP use the standard HTTP
480 URL syntax documented by RFC
1738, so they are of the form:
</p>
482 <div class=
"literalblock">
483 <div class=
"content">
484 <pre>http://
<host
>:
<port
>/
<path
>?
<searchpart
></pre>
487 <div class=
"paragraph">
488 <p>Within this documentation the placeholder
<code>$GIT_URL
</code> will stand for
489 the http:// repository URL entered by the end-user.
</p>
491 <div class=
"paragraph">
492 <p>Servers SHOULD handle all requests to locations matching
<code>$GIT_URL
</code>, as
493 both the
"smart" and
"dumb" HTTP protocols used by Git operate
494 by appending additional path components onto the end of the user
495 supplied
<code>$GIT_URL
</code> string.
</p>
497 <div class=
"paragraph">
498 <p>An example of a dumb client requesting a loose object:
</p>
500 <div class=
"literalblock">
501 <div class=
"content">
502 <pre>$GIT_URL: http://example.com:
8080/git/repo.git
503 URL request: http://example.com:
8080/git/repo.git/objects/d0/
49f6c27a2244e12041955e262a404c7faba355
</pre>
506 <div class=
"paragraph">
507 <p>An example of a smart request to a catch-all gateway:
</p>
509 <div class=
"literalblock">
510 <div class=
"content">
511 <pre>$GIT_URL: http://example.com/daemon.cgi?svc=git
&q=
512 URL request: http://example.com/daemon.cgi?svc=git
&q=/info/refs
&service=git-receive-pack
</pre>
515 <div class=
"paragraph">
516 <p>An example of a request to a submodule:
</p>
518 <div class=
"literalblock">
519 <div class=
"content">
520 <pre>$GIT_URL: http://example.com/git/repo.git/path/submodule.git
521 URL request: http://example.com/git/repo.git/path/submodule.git/info/refs
</pre>
524 <div class=
"paragraph">
525 <p>Clients MUST strip a trailing
<code>/
</code>, if present, from the user supplied
526 <code>$GIT_URL
</code> string to prevent empty path tokens (
<code>//
</code>) from appearing
527 in any URL sent to a server. Compatible clients MUST expand
528 <code>$GIT_URL/info/refs
</code> as
<code>foo/info/refs
</code> and not
<code>foo//info/refs
</code>.
</p>
533 <h2 id=
"_authentication">Authentication
</h2>
534 <div class=
"sectionbody">
535 <div class=
"paragraph">
536 <p>Standard HTTP authentication is used if authentication is required
537 to access a repository, and MAY be configured and enforced by the
538 HTTP server software.
</p>
540 <div class=
"paragraph">
541 <p>Because Git repositories are accessed by standard path components
542 server administrators MAY use directory based permissions within
543 their HTTP server to control repository access.
</p>
545 <div class=
"paragraph">
546 <p>Clients SHOULD support Basic authentication as described by RFC
2617.
547 Servers SHOULD support Basic authentication by relying upon the
548 HTTP server placed in front of the Git server software.
</p>
550 <div class=
"paragraph">
551 <p>Servers SHOULD NOT require HTTP cookies for the purposes of
552 authentication or access control.
</p>
554 <div class=
"paragraph">
555 <p>Clients and servers MAY support other common forms of HTTP based
556 authentication, such as Digest authentication.
</p>
561 <h2 id=
"_ssl">SSL
</h2>
562 <div class=
"sectionbody">
563 <div class=
"paragraph">
564 <p>Clients and servers SHOULD support SSL, particularly to protect
565 passwords when relying on Basic HTTP authentication.
</p>
570 <h2 id=
"_session_state">Session State
</h2>
571 <div class=
"sectionbody">
572 <div class=
"paragraph">
573 <p>The Git over HTTP protocol (much like HTTP itself) is stateless
574 from the perspective of the HTTP server side. All state MUST be
575 retained and managed by the client process. This permits simple
576 round-robin load-balancing on the server side, without needing to
577 worry about state management.
</p>
579 <div class=
"paragraph">
580 <p>Clients MUST NOT require state management on the server side in
581 order to function correctly.
</p>
583 <div class=
"paragraph">
584 <p>Servers MUST NOT require HTTP cookies in order to function correctly.
585 Clients MAY store and forward HTTP cookies during request processing
586 as described by RFC
2616 (HTTP/
1.1). Servers SHOULD ignore any
587 cookies sent by a client.
</p>
592 <h2 id=
"_general_request_processing">General Request Processing
</h2>
593 <div class=
"sectionbody">
594 <div class=
"paragraph">
595 <p>Except where noted, all standard HTTP behavior SHOULD be assumed
596 by both client and server. This includes (but is not necessarily
599 <div class=
"paragraph">
600 <p>If there is no repository at
<code>$GIT_URL
</code>, or the resource pointed to by a
601 location matching
<code>$GIT_URL
</code> does not exist, the server MUST NOT respond
602 with
<code>200 OK
</code> response. A server SHOULD respond with
603 <code>404 Not Found
</code>,
<code>410 Gone
</code>, or any other suitable HTTP status code
604 which does not imply the resource exists as requested.
</p>
606 <div class=
"paragraph">
607 <p>If there is a repository at
<code>$GIT_URL
</code>, but access is not currently
608 permitted, the server MUST respond with the
<code>403 Forbidden
</code> HTTP
611 <div class=
"paragraph">
612 <p>Servers SHOULD support both HTTP
1.0 and HTTP
1.1.
613 Servers SHOULD support chunked encoding for both request and response
616 <div class=
"paragraph">
617 <p>Clients SHOULD support both HTTP
1.0 and HTTP
1.1.
618 Clients SHOULD support chunked encoding for both request and response
621 <div class=
"paragraph">
622 <p>Servers MAY return ETag and/or Last-Modified headers.
</p>
624 <div class=
"paragraph">
625 <p>Clients MAY revalidate cached entities by including If-Modified-Since
626 and/or If-None-Match request headers.
</p>
628 <div class=
"paragraph">
629 <p>Servers MAY return
<code>304 Not Modified
</code> if the relevant headers appear
630 in the request and the entity has not changed. Clients MUST treat
631 <code>304 Not Modified
</code> identical to
<code>200 OK
</code> by reusing the cached entity.
</p>
633 <div class=
"paragraph">
634 <p>Clients MAY reuse a cached entity without revalidation if the
635 Cache-Control and/or Expires header permits caching. Clients and
636 servers MUST follow RFC
2616 for cache controls.
</p>
641 <h2 id=
"_discovering_references">Discovering References
</h2>
642 <div class=
"sectionbody">
643 <div class=
"paragraph">
644 <p>All HTTP clients MUST begin either a fetch or a push exchange by
645 discovering the references available on the remote repository.
</p>
648 <h3 id=
"_dumb_clients">Dumb Clients
</h3>
649 <div class=
"paragraph">
650 <p>HTTP clients that only support the
"dumb" protocol MUST discover
651 references by making a request for the special info/refs file of
654 <div class=
"paragraph">
655 <p>Dumb HTTP clients MUST make a
<code>GET
</code> request to
<code>$GIT_URL/info/refs
</code>,
656 without any search/query parameters.
</p>
658 <div class=
"literalblock">
659 <div class=
"content">
660 <pre>C: GET $GIT_URL/info/refs HTTP/
1.0</pre>
663 <div class=
"literalblock">
664 <div class=
"content">
667 S:
95dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint
668 S: d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master
669 S:
2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0
670 S: a3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}
</pre>
673 <div class=
"paragraph">
674 <p>The Content-Type of the returned info/refs entity SHOULD be
675 <code>text/plain; charset=utf-
8</code>, but MAY be any content type.
676 Clients MUST NOT attempt to validate the returned Content-Type.
677 Dumb servers MUST NOT return a return type starting with
678 <code>application/x-git-
</code>.
</p>
680 <div class=
"paragraph">
681 <p>Cache-Control headers MAY be returned to disable caching of the
684 <div class=
"paragraph">
685 <p>When examining the response clients SHOULD only examine the HTTP
686 status code. Valid responses are
<code>200 OK
</code>, or
<code>304 Not Modified
</code>.
</p>
688 <div class=
"paragraph">
689 <p>The returned content is a UNIX formatted text file describing
690 each ref and its known value. The file SHOULD be sorted by name
691 according to the C locale ordering. The file SHOULD NOT include
692 the default ref named
<code>HEAD
</code>.
</p>
694 <div class=
"literalblock">
695 <div class=
"content">
696 <pre>info_refs = *( ref_record )
697 ref_record = any_ref / peeled_ref
</pre>
700 <div class=
"literalblock">
701 <div class=
"content">
702 <pre>any_ref = obj-id HTAB refname LF
703 peeled_ref = obj-id HTAB refname LF
704 obj-id HTAB refname
"^{}" LF
</pre>
709 <h3 id=
"_smart_clients">Smart Clients
</h3>
710 <div class=
"paragraph">
711 <p>HTTP clients that support the
"smart" protocol (or both the
712 "smart" and
"dumb" protocols) MUST discover references by making
713 a parameterized request for the info/refs file of the repository.
</p>
715 <div class=
"paragraph">
716 <p>The request MUST contain exactly one query parameter,
717 <code>service=$servicename
</code>, where
<code>$servicename
</code> MUST be the service
718 name the client wishes to contact to complete the operation.
719 The request MUST NOT contain additional query parameters.
</p>
721 <div class=
"literalblock">
722 <div class=
"content">
723 <pre>C: GET $GIT_URL/info/refs?service=git-upload-pack HTTP/
1.0</pre>
726 <div class=
"paragraph">
727 <p>dumb server reply:
</p>
729 <div class=
"literalblock">
730 <div class=
"content">
733 S:
95dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint
734 S: d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master
735 S:
2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0
736 S: a3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}
</pre>
739 <div class=
"paragraph">
740 <p>smart server reply:
</p>
742 <div class=
"literalblock">
743 <div class=
"content">
745 S: Content-Type: application/x-git-upload-pack-advertisement
746 S: Cache-Control: no-cache
748 S:
001e# service=git-upload-pack\n
750 S:
004895dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint\
0multi_ack\n
751 S:
003fd049f6c27a2244e12041955e262a404c7faba355 refs/heads/master\n
752 S:
003c2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0\n
753 S:
003fa3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}\n
757 <div class=
"paragraph">
758 <p>The client may send Extra Parameters (see
759 <a href=
"gitprotocol-pack.html">gitprotocol-pack(
5)
</a>) as a colon-separated string
760 in the Git-Protocol HTTP header.
</p>
762 <div class=
"paragraph">
763 <p>Uses the
<code>--http-backend-info-refs
</code> option to
764 <a href=
"git-upload-pack.html">git-upload-pack(
1)
</a>.
</p>
767 <h4 id=
"_dumb_server_response">Dumb Server Response
</h4>
768 <div class=
"paragraph">
769 <p>Dumb servers MUST respond with the dumb server reply format.
</p>
771 <div class=
"paragraph">
772 <p>See the prior section under dumb clients for a more detailed
773 description of the dumb server response.
</p>
777 <h4 id=
"_smart_server_response">Smart Server Response
</h4>
778 <div class=
"paragraph">
779 <p>If the server does not recognize the requested service name, or the
780 requested service name has been disabled by the server administrator,
781 the server MUST respond with the
<code>403 Forbidden
</code> HTTP status code.
</p>
783 <div class=
"paragraph">
784 <p>Otherwise, smart servers MUST respond with the smart server reply
785 format for the requested service name.
</p>
787 <div class=
"paragraph">
788 <p>Cache-Control headers SHOULD be used to disable caching of the
791 <div class=
"paragraph">
792 <p>The Content-Type MUST be
<code>application/x-$servicename-advertisement
</code>.
793 Clients SHOULD fall back to the dumb protocol if another content
794 type is returned. When falling back to the dumb protocol clients
795 SHOULD NOT make an additional request to
<code>$GIT_URL/info/refs
</code>, but
796 instead SHOULD use the response already in hand. Clients MUST NOT
797 continue if they do not support the dumb protocol.
</p>
799 <div class=
"paragraph">
800 <p>Clients MUST validate the status code is either
<code>200 OK
</code> or
801 <code>304 Not Modified
</code>.
</p>
803 <div class=
"paragraph">
804 <p>Clients MUST validate the first five bytes of the response entity
805 matches the regex
<code>^[
0-
9a-f]{
4}#
</code>. If this test fails, clients
806 MUST NOT continue.
</p>
808 <div class=
"paragraph">
809 <p>Clients MUST parse the entire response as a sequence of pkt-line
812 <div class=
"paragraph">
813 <p>Clients MUST verify the first pkt-line is
<code># service=$servicename
</code>.
814 Servers MUST set $servicename to be the request parameter value.
815 Servers SHOULD include an LF at the end of this line.
816 Clients MUST ignore an LF at the end of the line.
</p>
818 <div class=
"paragraph">
819 <p>Servers MUST terminate the response with the magic
<code>0000</code> end
822 <div class=
"paragraph">
823 <p>The returned response is a pkt-line stream describing each ref and
824 its known value. The stream SHOULD be sorted by name according to
825 the C locale ordering. The stream SHOULD include the default ref
826 named
<code>HEAD
</code> as the first ref. The stream MUST include capability
827 declarations behind a NUL on the first ref.
</p>
829 <div class=
"paragraph">
830 <p>The returned response contains
"version 1" if
"version=1" was sent as an
833 <div class=
"literalblock">
834 <div class=
"content">
835 <pre>smart_reply = PKT-LINE(
"# service=$servicename" LF)
840 ref_list = empty_list / non_empty_list
</pre>
843 <div class=
"literalblock">
844 <div class=
"content">
845 <pre>empty_list = PKT-LINE(zero-id SP
"capabilities^{}" NUL cap-list LF)
</pre>
848 <div class=
"literalblock">
849 <div class=
"content">
850 <pre>non_empty_list = PKT-LINE(obj-id SP name NUL cap_list LF)
854 <div class=
"literalblock">
855 <div class=
"content">
856 <pre>cap-list = capability *(SP capability)
857 capability =
1*(LC_ALPHA / DIGIT /
"-" /
"_")
858 LC_ALPHA = %x61-
7A
</pre>
861 <div class=
"literalblock">
862 <div class=
"content">
863 <pre>ref_record = any_ref / peeled_ref
864 any_ref = PKT-LINE(obj-id SP name LF)
865 peeled_ref = PKT-LINE(obj-id SP name LF)
866 PKT-LINE(obj-id SP name
"^{}" LF
</pre>
874 <h2 id=
"_smart_service_git_upload_pack">Smart Service git-upload-pack
</h2>
875 <div class=
"sectionbody">
876 <div class=
"paragraph">
877 <p>This service reads from the repository pointed to by
<code>$GIT_URL
</code>.
</p>
879 <div class=
"paragraph">
880 <p>Clients MUST first perform ref discovery with
881 <code>$GIT_URL/info/refs?service=git-upload-pack
</code>.
</p>
883 <div class=
"literalblock">
884 <div class=
"content">
885 <pre>C: POST $GIT_URL/git-upload-pack HTTP/
1.0
886 C: Content-Type: application/x-git-upload-pack-request
888 C:
0032want
0a53e9ddeaddad63ad106860237bbf53411d11a7\n
889 C:
0032have
441b40d833fdfa93eb2908e52742248faf0ee993\n
893 <div class=
"literalblock">
894 <div class=
"content">
896 S: Content-Type: application/x-git-upload-pack-result
897 S: Cache-Control: no-cache
899 S: ....ACK %s, continue
903 <div class=
"paragraph">
904 <p>Clients MUST NOT reuse or revalidate a cached response.
905 Servers MUST include sufficient Cache-Control headers
906 to prevent caching of the response.
</p>
908 <div class=
"paragraph">
909 <p>Servers SHOULD support all capabilities defined here.
</p>
911 <div class=
"paragraph">
912 <p>Clients MUST send at least one
"want" command in the request body.
913 Clients MUST NOT reference an id in a
"want" command which did not
914 appear in the response obtained through ref discovery unless the
915 server advertises capability
<code>allow-tip-sha1-in-want
</code> or
916 <code>allow-reachable-sha1-in-want
</code>.
</p>
918 <div class=
"literalblock">
919 <div class=
"content">
920 <pre>compute_request = want_list
923 request_end =
"0000" /
"done"</pre>
926 <div class=
"literalblock">
927 <div class=
"content">
928 <pre>want_list = PKT-LINE(want SP cap_list LF)
930 want_pkt = PKT-LINE(want LF)
932 cap_list = capability *(SP capability)
</pre>
935 <div class=
"literalblock">
936 <div class=
"content">
937 <pre>have_list = *PKT-LINE(
"have" SP id LF)
</pre>
940 <div class=
"paragraph">
941 <p>TODO: Document this further.
</p>
944 <h3 id=
"_the_negotiation_algorithm">The Negotiation Algorithm
</h3>
945 <div class=
"paragraph">
946 <p>The computation to select the minimal pack proceeds as follows
947 (C = client, S = server):
</p>
949 <div class=
"paragraph">
950 <p><em>init step:
</em></p>
952 <div class=
"paragraph">
953 <p>C: Use ref discovery to obtain the advertised refs.
</p>
955 <div class=
"paragraph">
956 <p>C: Place any object seen into set
<code>advertised
</code>.
</p>
958 <div class=
"paragraph">
959 <p>C: Build an empty set,
<code>common
</code>, to hold the objects that are later
960 determined to be on both ends.
</p>
962 <div class=
"paragraph">
963 <p>C: Build a set,
<code>want
</code>, of the objects from
<code>advertised
</code> that the client
964 wants to fetch, based on what it saw during ref discovery.
</p>
966 <div class=
"paragraph">
967 <p>C: Start a queue,
<code>c_pending
</code>, ordered by commit time (popping newest
968 first). Add all client refs. When a commit is popped from
969 the queue its parents SHOULD be automatically inserted back.
970 Commits MUST only enter the queue once.
</p>
972 <div class=
"paragraph">
973 <p><em>one compute step:
</em></p>
975 <div class=
"paragraph">
976 <p>C: Send one
<code>$GIT_URL/git-upload-pack
</code> request:
</p>
978 <div class=
"literalblock">
979 <div class=
"content">
980 <pre>C:
0032want
<want-#
1>...............................
981 C:
0032want
<want-#
2>...............................
983 C:
0032have
<common-#
1>.............................
984 C:
0032have
<common-#
2>.............................
986 C:
0032have
<have-#
1>...............................
987 C:
0032have
<have-#
2>...............................
992 <div class=
"paragraph">
993 <p>The stream is organized into
"commands", with each command
994 appearing by itself in a pkt-line. Within a command line,
995 the text leading up to the first space is the command name,
996 and the remainder of the line to the first LF is the value.
997 Command lines are terminated with an LF as the last byte of
998 the pkt-line value.
</p>
1000 <div class=
"paragraph">
1001 <p>Commands MUST appear in the following order, if they appear
1002 at all in the request stream:
</p>
1014 <div class=
"paragraph">
1015 <p>The stream is terminated by a pkt-line flush (
<code>0000</code>).
</p>
1017 <div class=
"paragraph">
1018 <p>A single
"want" or
"have" command MUST have one hex formatted
1019 object name as its value. Multiple object names MUST be sent by sending
1020 multiple commands. Object names MUST be given using the object format
1021 negotiated through the
<code>object-format
</code> capability (default SHA-
1).
</p>
1023 <div class=
"paragraph">
1024 <p>The
<code>have
</code> list is created by popping the first
32 commits
1025 from
<code>c_pending
</code>. Fewer can be supplied if
<code>c_pending
</code> empties.
</p>
1027 <div class=
"paragraph">
1028 <p>If the client has sent
256 "have" commits and has not yet
1029 received one of those back from
<code>s_common
</code>, or the client has
1030 emptied
<code>c_pending
</code> it SHOULD include a
"done" command to let
1031 the server know it won
’t proceed:
</p>
1033 <div class=
"literalblock">
1034 <div class=
"content">
1035 <pre>C:
0009done
</pre>
1038 <div class=
"paragraph">
1039 <p>S: Parse the git-upload-pack request:
</p>
1041 <div class=
"paragraph">
1042 <p>Verify all objects in
<code>want
</code> are directly reachable from refs.
</p>
1044 <div class=
"paragraph">
1045 <p>The server MAY walk backwards through history or through
1046 the reflog to permit slightly stale requests.
</p>
1048 <div class=
"paragraph">
1049 <p>If no
"want" objects are received, send an error:
1050 TODO: Define error if no
"want" lines are requested.
</p>
1052 <div class=
"paragraph">
1053 <p>If any
"want" object is not reachable, send an error:
1054 TODO: Define error if an invalid
"want" is requested.
</p>
1056 <div class=
"paragraph">
1057 <p>Create an empty list,
<code>s_common
</code>.
</p>
1059 <div class=
"paragraph">
1060 <p>If
"have" was sent:
</p>
1062 <div class=
"paragraph">
1063 <p>Loop through the objects in the order supplied by the client.
</p>
1065 <div class=
"paragraph">
1066 <p>For each object, if the server has the object reachable from
1067 a ref, add it to
<code>s_common
</code>. If a commit is added to
<code>s_common
</code>,
1068 do not add any ancestors, even if they also appear in
<code>have
</code>.
</p>
1070 <div class=
"paragraph">
1071 <p>S: Send the git-upload-pack response:
</p>
1073 <div class=
"paragraph">
1074 <p>If the server has found a closed set of objects to pack or the
1075 request ends with
"done", it replies with the pack.
1076 TODO: Document the pack based response
</p>
1078 <div class=
"literalblock">
1079 <div class=
"content">
1080 <pre>S: PACK...
</pre>
1083 <div class=
"paragraph">
1084 <p>The returned stream is the side-band-
64k protocol supported
1085 by the git-upload-pack service, and the pack is embedded into
1086 stream
1. Progress messages from the server side MAY appear
1089 <div class=
"paragraph">
1090 <p>Here a
"closed set of objects" is defined to have at least
1091 one path from every
"want" to at least one
"common" object.
</p>
1093 <div class=
"paragraph">
1094 <p>If the server needs more information, it replies with a
1095 status continue response:
1096 TODO: Document the non-pack response
</p>
1098 <div class=
"paragraph">
1099 <p>C: Parse the upload-pack response:
1100 TODO: Document parsing response
</p>
1102 <div class=
"paragraph">
1103 <p><em>Do another compute step.
</em></p>
1109 <h2 id=
"_smart_service_git_receive_pack">Smart Service git-receive-pack
</h2>
1110 <div class=
"sectionbody">
1111 <div class=
"paragraph">
1112 <p>This service reads from the repository pointed to by
<code>$GIT_URL
</code>.
</p>
1114 <div class=
"paragraph">
1115 <p>Clients MUST first perform ref discovery with
1116 <code>$GIT_URL/info/refs?service=git-receive-pack
</code>.
</p>
1118 <div class=
"literalblock">
1119 <div class=
"content">
1120 <pre>C: POST $GIT_URL/git-receive-pack HTTP/
1.0
1121 C: Content-Type: application/x-git-receive-pack-request
1123 C: ...
.0a53e9ddeaddad63ad106860237bbf53411d11a7
441b40d833fdfa93eb2908e52742248faf0ee993 refs/heads/maint\
0 report-status
1128 <div class=
"literalblock">
1129 <div class=
"content">
1131 S: Content-Type: application/x-git-receive-pack-result
1132 S: Cache-Control: no-cache
1137 <div class=
"paragraph">
1138 <p>Clients MUST NOT reuse or revalidate a cached response.
1139 Servers MUST include sufficient Cache-Control headers
1140 to prevent caching of the response.
</p>
1142 <div class=
"paragraph">
1143 <p>Servers SHOULD support all capabilities defined here.
</p>
1145 <div class=
"paragraph">
1146 <p>Clients MUST send at least one command in the request body.
1147 Within the command portion of the request body clients SHOULD send
1148 the id obtained through ref discovery as old_id.
</p>
1150 <div class=
"literalblock">
1151 <div class=
"content">
1152 <pre>update_request = command_list
1153 "PACK" <binary-data
></pre>
1156 <div class=
"literalblock">
1157 <div class=
"content">
1158 <pre>command_list = PKT-LINE(command NUL cap_list LF)
1160 command_pkt = PKT-LINE(command LF)
1161 cap_list = *(SP capability) SP
</pre>
1164 <div class=
"literalblock">
1165 <div class=
"content">
1166 <pre>command = create / delete / update
1167 create = zero-id SP new_id SP name
1168 delete = old_id SP zero-id SP name
1169 update = old_id SP new_id SP name
</pre>
1172 <div class=
"paragraph">
1173 <p>TODO: Document this further.
</p>
1178 <h2 id=
"_references">REFERENCES
</h2>
1179 <div class=
"sectionbody">
1180 <div class=
"paragraph">
1181 <p><a href=
"https://www.ietf.org/rfc/rfc1738.txt">RFC
1738: Uniform Resource Locators (URL)
</a>
1182 <a href=
"https://www.ietf.org/rfc/rfc2616.txt">RFC
2616: Hypertext Transfer Protocol
 — HTTP/
1.1</a></p>
1187 <h2 id=
"_see_also">SEE ALSO
</h2>
1188 <div class=
"sectionbody">
1189 <div class=
"paragraph">
1190 <p><a href=
"gitprotocol-pack.html">gitprotocol-pack(
5)
</a>
1191 <a href=
"gitprotocol-capabilities.html">gitprotocol-capabilities(
5)
</a></p>
1196 <h2 id=
"_git">GIT
</h2>
1197 <div class=
"sectionbody">
1198 <div class=
"paragraph">
1199 <p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p>
1205 <div id=
"footer-text">
1206 Last updated
2024-
02-
08 15:
45:
59 -
0800