blob: ff428c375535b46c1c74b751a6f22a6240b51af5 [file] [log] [blame]
Junio C Hamano944ce252018-05-30 22:25:261<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano11821ed2011-10-19 18:42:092<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9d971152012-12-19 00:43:116<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano98c882d2020-08-13 22:06:577<meta name="generator" content="AsciiDoc 9.0.0rc2" />
Junio C Hamano11821ed2011-10-19 18:42:098<title>gitweb(1)</title>
9<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:1110/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano11821ed2011-10-19 18:42:0925}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
31a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
38
39em {
40 font-style: italic;
41 color: navy;
42}
43
44strong {
45 font-weight: bold;
46 color: #083194;
47}
48
Junio C Hamano11821ed2011-10-19 18:42:0949h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamano11821ed2011-10-19 18:42:0951 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
56h1, h2, h3 {
57 border-bottom: 2px solid silver;
58}
59h2 {
60 padding-top: 0.5em;
61}
62h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9d971152012-12-19 00:43:1168h5 {
69 font-size: 1.0em;
70}
Junio C Hamano11821ed2011-10-19 18:42:0971
72div.sectionbody {
Junio C Hamano11821ed2011-10-19 18:42:0973 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
85ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9d971152012-12-19 00:43:1188ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamano11821ed2011-10-19 18:42:0990
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamano11821ed2011-10-19 18:42:0995 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamano11821ed2011-10-19 18:42:09101
Junio C Hamano9d971152012-12-19 00:43:11102#author {
Junio C Hamano11821ed2011-10-19 18:42:09103 color: #527bbd;
Junio C Hamano11821ed2011-10-19 18:42:09104 font-weight: bold;
105 font-size: 1.1em;
106}
Junio C Hamano9d971152012-12-19 00:43:11107#email {
Junio C Hamano11821ed2011-10-19 18:42:09108}
Junio C Hamano9d971152012-12-19 00:43:11109#revnumber, #revdate, #revremark {
Junio C Hamano11821ed2011-10-19 18:42:09110}
111
Junio C Hamano9d971152012-12-19 00:43:11112#footer {
Junio C Hamano11821ed2011-10-19 18:42:09113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9d971152012-12-19 00:43:11118#footer-text {
Junio C Hamano11821ed2011-10-19 18:42:09119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9d971152012-12-19 00:43:11122#footer-badges {
Junio C Hamano11821ed2011-10-19 18:42:09123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9d971152012-12-19 00:43:11127#preamble {
Junio C Hamano11821ed2011-10-19 18:42:09128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9d971152012-12-19 00:43:11131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano11821ed2011-10-19 18:42:09132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
150 color: #527bbd;
Junio C Hamano11821ed2011-10-19 18:42:09151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamano11821ed2011-10-19 18:42:09174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamano11821ed2011-10-19 18:42:09181 padding: 0.5em;
182}
183
184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamano11821ed2011-10-19 18:42:09190}
191
192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
195}
196
Junio C Hamano9d971152012-12-19 00:43:11197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamano11821ed2011-10-19 18:42:09200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206div.verseblock + div.attribution {
207 text-align: left;
208}
209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
221}
222
223div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
226}
227
228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano11821ed2011-10-19 18:42:09230a.image:visited { color: white; }
231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
241}
242dd > *:first-child {
243 margin-top: 0.1em;
244}
245
246ul, ol {
247 list-style-position: outside;
248}
249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
253 list-style-type: lower-alpha;
254}
255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
271
Junio C Hamano11821ed2011-10-19 18:42:09272tfoot {
273 font-weight: bold;
274}
275td > div.verse {
276 white-space: pre;
277}
Junio C Hamano11821ed2011-10-19 18:42:09278
279div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
283div.hdlist tr {
284 padding-bottom: 15px;
285}
286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
294}
295td.hdlist2 {
296 vertical-align: top;
297}
298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
306
307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9d971152012-12-19 00:43:11334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamano11821ed2011-10-19 18:42:09341}
342
Junio C Hamano9d971152012-12-19 00:43:11343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamano11821ed2011-10-19 18:42:09348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9d971152012-12-19 00:43:11351#toctitle {
Junio C Hamano11821ed2011-10-19 18:42:09352 color: #527bbd;
Junio C Hamano11821ed2011-10-19 18:42:09353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamano11821ed2011-10-19 18:42:09360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamano9d971152012-12-19 00:43:11375
376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9d971152012-12-19 00:43:11419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
428}
429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
Junio C Hamano725b0da2020-01-22 22:02:40439/* Because the table frame attribute is overridden by CSS in most browsers. */
Junio C Hamano9d971152012-12-19 00:43:11440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
450}
451
452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
481}
482
483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
503}
504
505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
507}
508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
513}
514
515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
Junio C Hamano11821ed2011-10-19 18:42:09522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage h2 {
Junio C Hamano11821ed2011-10-19 18:42:09528 border-style: none;
529}
Junio C Hamano9d971152012-12-19 00:43:11530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamano11821ed2011-10-19 18:42:09532}
533
534@media print {
Junio C Hamano9d971152012-12-19 00:43:11535 body.manpage div#toc { display: none; }
Junio C Hamano11821ed2011-10-19 18:42:09536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamano11821ed2011-10-19 18:42:09539</style>
540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano11821ed2011-10-19 18:42:09542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano11821ed2011-10-19 18:42:09584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
Junio C Hamano11821ed2011-10-19 18:42:09622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamano11821ed2011-10-19 18:42:09651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
Junio C Hamano11821ed2011-10-19 18:42:09667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
Junio C Hamano9d971152012-12-19 00:43:11673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
Junio C Hamano11821ed2011-10-19 18:42:09683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamano11821ed2011-10-19 18:42:09687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
Junio C Hamano9d971152012-12-19 00:43:11706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
Junio C Hamano11821ed2011-10-19 18:42:09728}
729
730}
Junio C Hamano9d971152012-12-19 00:43:11731asciidoc.install();
Junio C Hamano11821ed2011-10-19 18:42:09732/*]]>*/
733</script>
734</head>
Junio C Hamano9d971152012-12-19 00:43:11735<body class="manpage">
Junio C Hamano11821ed2011-10-19 18:42:09736<div id="header">
737<h1>
738gitweb(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>gitweb -
743 Git web interface (web frontend to Git repositories)
744</p>
745</div>
746</div>
747<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11748<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:09749<h2 id="_synopsis">SYNOPSIS</h2>
750<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21751<div class="paragraph"><p>To get started with gitweb, run <a href="git-instaweb.html">git-instaweb(1)</a> from a Git repository.
Junio C Hamano11821ed2011-10-19 18:42:09752This would configure and start your web server, and run web browser pointing to
753gitweb.</p></div>
754</div>
Junio C Hamano9d971152012-12-19 00:43:11755</div>
756<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:09757<h2 id="_description">DESCRIPTION</h2>
758<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21759<div class="paragraph"><p>Gitweb provides a web interface to Git repositories. Its features include:</p></div>
Junio C Hamano11821ed2011-10-19 18:42:09760<div class="ulist"><ul>
761<li>
762<p>
763Viewing multiple Git repositories with common root.
764</p>
765</li>
766<li>
767<p>
768Browsing every revision of the repository.
769</p>
770</li>
771<li>
772<p>
773Viewing the contents of files in the repository at any revision.
774</p>
775</li>
776<li>
777<p>
778Viewing the revision log of branches, history of files and directories,
779 see what was changed when, by who.
780</p>
781</li>
782<li>
783<p>
784Viewing the blame/annotation details of any file (if enabled).
785</p>
786</li>
787<li>
788<p>
789Generating RSS and Atom feeds of commits, for any branch.
790 The feeds are auto-discoverable in modern web browsers.
791</p>
792</li>
793<li>
794<p>
795Viewing everything that was changed in a revision, and step through
796 revisions one at a time, viewing the history of the repository.
797</p>
798</li>
799<li>
800<p>
801Finding commits which commit messages matches given search term.
802</p>
803</li>
804</ul></div>
Junio C Hamanoc9f11c22019-07-10 02:54:04805<div class="paragraph"><p>See <a href="http://repo.or.cz/w/git.git/tree/HEAD:/gitweb/">http://repo.or.cz/w/git.git/tree/HEAD:/gitweb/</a> for gitweb source code,
Junio C Hamano11821ed2011-10-19 18:42:09806browsed using gitweb itself.</p></div>
807</div>
Junio C Hamano9d971152012-12-19 00:43:11808</div>
809<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:09810<h2 id="_configuration">CONFIGURATION</h2>
811<div class="sectionbody">
812<div class="paragraph"><p>Various aspects of gitweb&#8217;s behavior can be controlled through the configuration
Junio C Hamanob5513772019-04-22 03:38:39813file <code>gitweb_config.perl</code> or <code>/etc/gitweb.conf</code>. See the <a href="gitweb.conf.html">gitweb.conf(5)</a>
Junio C Hamano11821ed2011-10-19 18:42:09814for details.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11815<div class="sect2">
816<h3 id="_repositories">Repositories</h3>
Junio C Hamano11821ed2011-10-19 18:42:09817<div class="paragraph"><p>Gitweb can show information from one or more Git repositories. These
818repositories have to be all on local filesystem, and have to share common
819repository root, i.e. be all under a single parent repository (but see also
820"Advanced web server setup" section, "Webserver configuration with multiple
821projects' root" subsection).</p></div>
822<div class="listingblock">
823<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53824<pre><code>our $projectroot = '/path/to/parent/directory';</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:09825</div></div>
Junio C Hamanob5513772019-04-22 03:38:39826<div class="paragraph"><p>The default value for <code>$projectroot</code> is <code>/pub/git</code>. You can change it during
Junio C Hamanoc14e6ad2014-10-31 20:25:53827building gitweb via <code>GITWEB_PROJECTROOT</code> build configuration variable.</p></div>
828<div class="paragraph"><p>By default all Git repositories under <code>$projectroot</code> are visible and available
Junio C Hamano11821ed2011-10-19 18:42:09829to gitweb. The list of projects is generated by default by scanning the
Junio C Hamanoc14e6ad2014-10-31 20:25:53830<code>$projectroot</code> directory for Git repositories (for object databases to be
Junio C Hamano11821ed2011-10-19 18:42:09831more exact; gitweb is not interested in a working area, and is best suited
832to showing "bare" repositories).</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53833<div class="paragraph"><p>The name of the repository in gitweb is the path to its <code>$GIT_DIR</code> (its object
834database) relative to <code>$projectroot</code>. Therefore the repository $repo can be
Junio C Hamano11821ed2011-10-19 18:42:09835found at "$projectroot/$repo".</p></div>
Junio C Hamano9d971152012-12-19 00:43:11836</div>
837<div class="sect2">
838<h3 id="_projects_list_file_format">Projects list file format</h3>
Junio C Hamano11821ed2011-10-19 18:42:09839<div class="paragraph"><p>Instead of having gitweb find repositories by scanning filesystem
840starting from $projectroot, you can provide a pre-generated list of
Junio C Hamanoc14e6ad2014-10-31 20:25:53841visible projects by setting <code>$projects_list</code> to point to a plain text
Junio C Hamano11821ed2011-10-19 18:42:09842file with a list of projects (with some additional info).</p></div>
843<div class="paragraph"><p>This file uses the following format:</p></div>
844<div class="ulist"><ul>
845<li>
846<p>
847One record (for project / repository) per line; does not support line
848continuation (newline escaping).
849</p>
850</li>
851<li>
852<p>
853Leading and trailing whitespace are ignored.
854</p>
855</li>
856<li>
857<p>
858Whitespace separated fields; any run of whitespace can be used as field
Junio C Hamanoc14e6ad2014-10-31 20:25:53859separator (rules for Perl&#8217;s "<code>split(" ", $line)</code>").
Junio C Hamano11821ed2011-10-19 18:42:09860</p>
861</li>
862<li>
863<p>
864Fields use modified URI encoding, defined in RFC 3986, section 2.1
865(Percent-Encoding), or rather "Query string encoding" (see
Junio C Hamano6b6144f2017-05-29 06:20:15866<a href="https://en.wikipedia.org/wiki/Query_string#URL_encoding">https://en.wikipedia.org/wiki/Query_string#URL_encoding</a>), the difference
Junio C Hamano11821ed2011-10-19 18:42:09867being that SP (" ") can be encoded as "&#43;" (and therefore "&#43;" has to be
868also percent-encoded).
869</p>
870<div class="paragraph"><p>Reserved characters are: "%" (used for encoding), "&#43;" (can be used to
871encode SPACE), all whitespace characters as defined in Perl, including SP,
872TAB and LF, (used to separate fields in a record).</p></div>
873</li>
874<li>
875<p>
876Currently recognized fields are:
877</p>
878<div class="dlist"><dl>
879<dt class="hdlist1">
880&lt;repository path&gt;
881</dt>
882<dd>
883<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53884 path to repository GIT_DIR, relative to <code>$projectroot</code>
Junio C Hamano11821ed2011-10-19 18:42:09885</p>
886</dd>
887<dt class="hdlist1">
888&lt;repository owner&gt;
889</dt>
890<dd>
891<p>
892 displayed as repository owner, preferably full name, or email,
893 or both
894</p>
895</dd>
896</dl></div>
897</li>
898</ul></div>
899<div class="paragraph"><p>You can generate the projects list index file using the project_index action
900(the <em>TXT</em> link on projects list page) directly from gitweb; see also
901"Generating projects list using gitweb" section below.</p></div>
902<div class="paragraph"><p>Example contents:</p></div>
903<div class="listingblock">
904<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53905<pre><code>foo.git Joe+R+Hacker+&lt;joe@example.com&gt;
906foo/bar.git O+W+Ner+&lt;owner@example.org&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:09907</div></div>
908<div class="paragraph"><p>By default this file controls only which projects are <strong>visible</strong> on projects
Junio C Hamano076ffcc2013-02-06 05:13:21909list page (note that entries that do not point to correctly recognized Git
Junio C Hamano11821ed2011-10-19 18:42:09910repositories won&#8217;t be displayed by gitweb). Even if a project is not
911visible on projects list page, you can view it nevertheless by hand-crafting
Junio C Hamanoc14e6ad2014-10-31 20:25:53912a gitweb URL. By setting <code>$strict_export</code> configuration variable (see
Junio C Hamanoa28a9202012-06-21 07:08:23913<a href="gitweb.conf.html">gitweb.conf(5)</a>) to true value you can allow viewing only of
Junio C Hamano11821ed2011-10-19 18:42:09914repositories also shown on the overview page (i.e. only projects explicitly
915listed in projects list file will be accessible).</p></div>
Junio C Hamano9d971152012-12-19 00:43:11916</div>
917<div class="sect2">
918<h3 id="_generating_projects_list_using_gitweb">Generating projects list using gitweb</h3>
Junio C Hamano11821ed2011-10-19 18:42:09919<div class="paragraph"><p>We assume that GITWEB_CONFIG has its default Makefile value, namely
920<em>gitweb_config.perl</em>. Put the following in <em>gitweb_make_index.perl</em> file:</p></div>
921<div class="listingblock">
922<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53923<pre><code>read_config_file("gitweb_config.perl");
924$projects_list = $projectroot;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:09925</div></div>
926<div class="paragraph"><p>Then create the following script to get list of project in the format
927suitable for GITWEB_LIST build configuration variable (or
Junio C Hamanoc14e6ad2014-10-31 20:25:53928<code>$projects_list</code> variable in gitweb config):</p></div>
Junio C Hamano11821ed2011-10-19 18:42:09929<div class="listingblock">
930<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53931<pre><code>#!/bin/sh
Junio C Hamano11821ed2011-10-19 18:42:09932
933export GITWEB_CONFIG="gitweb_make_index.perl"
934export GATEWAY_INTERFACE="CGI/1.1"
935export HTTP_ACCEPT="*/*"
936export REQUEST_METHOD="GET"
937export QUERY_STRING="a=project_index"
938
Junio C Hamanoc14e6ad2014-10-31 20:25:53939perl -- /var/www/cgi-bin/gitweb.cgi</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:09940</div></div>
941<div class="paragraph"><p>Run this script and save its output to a file. This file could then be used
Junio C Hamanoc14e6ad2014-10-31 20:25:53942as projects list file, which means that you can set <code>$projects_list</code> to its
Junio C Hamano11821ed2011-10-19 18:42:09943filename.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11944</div>
945<div class="sect2">
Junio C Hamano076ffcc2013-02-06 05:13:21946<h3 id="_controlling_access_to_git_repositories">Controlling access to Git repositories</h3>
Junio C Hamanoc14e6ad2014-10-31 20:25:53947<div class="paragraph"><p>By default all Git repositories under <code>$projectroot</code> are visible and
Junio C Hamano11821ed2011-10-19 18:42:09948available to gitweb. You can however configure how gitweb controls access
949to repositories.</p></div>
950<div class="ulist"><ul>
951<li>
952<p>
953As described in "Projects list file format" section, you can control which
954projects are <strong>visible</strong> by selectively including repositories in projects
Junio C Hamanoc14e6ad2014-10-31 20:25:53955list file, and setting <code>$projects_list</code> gitweb configuration variable to
956point to it. With <code>$strict_export</code> set, projects list file can be used to
Junio C Hamano11821ed2011-10-19 18:42:09957control which repositories are <strong>available</strong> as well.
958</p>
959</li>
960<li>
961<p>
962You can configure gitweb to only list and allow viewing of the explicitly
Junio C Hamanoc14e6ad2014-10-31 20:25:53963exported repositories, via <code>$export_ok</code> variable in gitweb config file; see
Junio C Hamanoa28a9202012-06-21 07:08:23964<a href="gitweb.conf.html">gitweb.conf(5)</a> manpage. If it evaluates to true, gitweb shows
Junio C Hamanoc14e6ad2014-10-31 20:25:53965repositories only if this file named by <code>$export_ok</code> exists in its object
966database (if directory has the magic file named <code>$export_ok</code>).
Junio C Hamano11821ed2011-10-19 18:42:09967</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53968<div class="paragraph"><p>For example <a href="git-daemon.html">git-daemon(1)</a> by default (unless <code>--export-all</code> option
Junio C Hamano11821ed2011-10-19 18:42:09969is used) allows pulling only for those repositories that have
970<em>git-daemon-export-ok</em> file. Adding</p></div>
971<div class="listingblock">
972<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53973<pre><code>our $export_ok = "git-daemon-export-ok";</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:09974</div></div>
975<div class="paragraph"><p>makes gitweb show and allow access only to those repositories that can be
Junio C Hamanoc14e6ad2014-10-31 20:25:53976fetched from via <code>git://</code> protocol.</p></div>
Junio C Hamano11821ed2011-10-19 18:42:09977</li>
978<li>
979<p>
980Finally, it is possible to specify an arbitrary perl subroutine that will
981be called for each repository to determine if it can be exported. The
982subroutine receives an absolute path to the project (repository) as its only
983parameter (i.e. "$projectroot/$project").
984</p>
985<div class="paragraph"><p>For example, if you use mod_perl to run the script, and have dumb
986HTTP protocol authentication configured for your repositories, you
987can use the following hook to allow access only if the user is
988authorized to read the files:</p></div>
989<div class="listingblock">
990<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53991<pre><code>$export_auth_hook = sub {
Junio C Hamano11821ed2011-10-19 18:42:09992 use Apache2::SubRequest ();
993 use Apache2::Const -compile =&gt; qw(HTTP_OK);
994 my $path = "$_[0]/HEAD";
995 my $r = Apache2::RequestUtil-&gt;request;
996 my $sub = $r-&gt;lookup_file($path);
997 return $sub-&gt;filename eq $path
998 &amp;&amp; $sub-&gt;status == Apache2::Const::HTTP_OK;
Junio C Hamanoc14e6ad2014-10-31 20:25:53999};</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091000</div></div>
1001</li>
1002</ul></div>
Junio C Hamano9d971152012-12-19 00:43:111003</div>
1004<div class="sect2">
1005<h3 id="_per_repository_gitweb_configuration">Per-repository gitweb configuration</h3>
Junio C Hamano11821ed2011-10-19 18:42:091006<div class="paragraph"><p>You can configure individual repositories shown in gitweb by creating file
Junio C Hamano042f2142016-06-27 18:05:051007in the <code>GIT_DIR</code> of Git repository, or by setting some repo configuration
1008variable (in <code>GIT_DIR/config</code>, see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091009<div class="paragraph"><p>You can use the following files in repository:</p></div>
1010<div class="dlist"><dl>
1011<dt class="hdlist1">
1012README.html
1013</dt>
1014<dd>
1015<p>
1016 A html file (HTML fragment) which is included on the gitweb project
Junio C Hamanoc14e6ad2014-10-31 20:25:531017 "summary" page inside <code>&lt;div&gt;</code> block element. You can use it for longer
Junio C Hamano11821ed2011-10-19 18:42:091018 description of a project, to provide links (for example to project&#8217;s
1019 homepage), etc. This is recognized only if XSS prevention is off
Junio C Hamanoc14e6ad2014-10-31 20:25:531020 (<code>$prevent_xss</code> is false, see <a href="gitweb.conf.html">gitweb.conf(5)</a>); a way to include
Junio C Hamano11821ed2011-10-19 18:42:091021 a README safely when XSS prevention is on may be worked out in the
1022 future.
1023</p>
1024</dd>
1025<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531026description (or <code>gitweb.description</code>)
Junio C Hamano11821ed2011-10-19 18:42:091027</dt>
1028<dd>
1029<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531030 Short (shortened to <code>$projects_list_description_width</code> in the projects
Junio C Hamano11821ed2011-10-19 18:42:091031 list page, which is 25 characters by default; see
Junio C Hamanoa28a9202012-06-21 07:08:231032 <a href="gitweb.conf.html">gitweb.conf(5)</a>) single line description of a project (of a
Junio C Hamano11821ed2011-10-19 18:42:091033 repository). Plain text file; HTML will be escaped. By default set to
1034</p>
1035<div class="listingblock">
1036<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531037<pre><code>Unnamed repository; edit this file to name it for gitweb.</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091038</div></div>
1039<div class="paragraph"><p>from the template during repository creation, usually installed in
Junio C Hamanob5513772019-04-22 03:38:391040<code>/usr/share/git-core/templates/</code>. You can use the <code>gitweb.description</code> repo
Junio C Hamano11821ed2011-10-19 18:42:091041configuration variable, but the file takes precedence.</p></div>
1042</dd>
1043<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531044category (or <code>gitweb.category</code>)
Junio C Hamano11821ed2011-10-19 18:42:091045</dt>
1046<dd>
1047<p>
1048 Singe line category of a project, used to group projects if
Junio C Hamanoc14e6ad2014-10-31 20:25:531049 <code>$projects_list_group_categories</code> is enabled. By default (file and
Junio C Hamano11821ed2011-10-19 18:42:091050 configuration variable absent), uncategorized projects are put in the
Junio C Hamanoc14e6ad2014-10-31 20:25:531051 <code>$project_list_default_category</code> category. You can use the
1052 <code>gitweb.category</code> repo configuration variable, but the file takes
Junio C Hamano11821ed2011-10-19 18:42:091053 precedence.
1054</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531055<div class="paragraph"><p>The configuration variables <code>$projects_list_group_categories</code> and
1056<code>$project_list_default_category</code> are described in <a href="gitweb.conf.html">gitweb.conf(5)</a></p></div>
Junio C Hamano11821ed2011-10-19 18:42:091057</dd>
1058<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531059cloneurl (or multiple-valued <code>gitweb.url</code>)
Junio C Hamano11821ed2011-10-19 18:42:091060</dt>
1061<dd>
1062<p>
1063 File with repository URL (used for clone and fetch), one per line.
1064 Displayed in the project summary page. You can use multiple-valued
Junio C Hamanoc14e6ad2014-10-31 20:25:531065 <code>gitweb.url</code> repository configuration variable for that, but the file
Junio C Hamano11821ed2011-10-19 18:42:091066 takes precedence.
1067</p>
1068<div class="paragraph"><p>This is per-repository enhancement / version of global prefix-based
Junio C Hamanoc14e6ad2014-10-31 20:25:531069<code>@git_base_url_list</code> gitweb configuration variable (see
Junio C Hamanoa28a9202012-06-21 07:08:231070<a href="gitweb.conf.html">gitweb.conf(5)</a>).</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091071</dd>
1072<dt class="hdlist1">
1073gitweb.owner
1074</dt>
1075<dd>
1076<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531077 You can use the <code>gitweb.owner</code> repository configuration variable to set
Junio C Hamano11821ed2011-10-19 18:42:091078 repository&#8217;s owner. It is displayed in the project list and summary
1079 page.
1080</p>
1081<div class="paragraph"><p>If it&#8217;s not set, filesystem directory&#8217;s owner is used (via GECOS field,
Junio C Hamanoc14e6ad2014-10-31 20:25:531082i.e. real name field from <strong>getpwuid</strong>(3)) if <code>$projects_list</code> is unset
1083(gitweb scans <code>$projectroot</code> for repositories); if <code>$projects_list</code>
Junio C Hamano11821ed2011-10-19 18:42:091084points to file with list of repositories, then project owner defaults to
1085value from this file for given repository.</p></div>
1086</dd>
1087<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531088various <code>gitweb.*</code> config variables (in config)
Junio C Hamano11821ed2011-10-19 18:42:091089</dt>
1090<dd>
1091<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531092 Read description of <code>%feature</code> hash for detailed list, and descriptions.
Junio C Hamanoa28a9202012-06-21 07:08:231093 See also "Configuring gitweb features" section in <a href="gitweb.conf.html">gitweb.conf(5)</a>
Junio C Hamano11821ed2011-10-19 18:42:091094</p>
1095</dd>
1096</dl></div>
1097</div>
Junio C Hamano9d971152012-12-19 00:43:111098</div>
1099</div>
1100<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:091101<h2 id="_actions_and_urls">ACTIONS, AND URLS</h2>
1102<div class="sectionbody">
1103<div class="paragraph"><p>Gitweb can use path_info (component) based URLs, or it can pass all necessary
1104information via query parameters. The typical gitweb URLs are broken down in to
1105five components:</p></div>
1106<div class="listingblock">
1107<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531108<pre><code>.../gitweb.cgi/&lt;repo&gt;/&lt;action&gt;/&lt;revision&gt;:/&lt;path&gt;?&lt;arguments&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091109</div></div>
1110<div class="dlist"><dl>
1111<dt class="hdlist1">
1112repo
1113</dt>
1114<dd>
1115<p>
1116 The repository the action will be performed on.
1117</p>
1118<div class="paragraph"><p>All actions except for those that list all available projects,
1119in whatever form, require this parameter.</p></div>
1120</dd>
1121<dt class="hdlist1">
1122action
1123</dt>
1124<dd>
1125<p>
1126 The action that will be run. Defaults to <em>projects_list</em> if repo
1127 is not set, and to <em>summary</em> otherwise.
1128</p>
1129</dd>
1130<dt class="hdlist1">
1131revision
1132</dt>
1133<dd>
1134<p>
1135 Revision shown. Defaults to HEAD.
1136</p>
1137</dd>
1138<dt class="hdlist1">
1139path
1140</dt>
1141<dd>
1142<p>
1143 The path within the &lt;repository&gt; that the action is performed on,
1144 for those actions that require it.
1145</p>
1146</dd>
1147<dt class="hdlist1">
1148arguments
1149</dt>
1150<dd>
1151<p>
1152 Any arguments that control the behaviour of the action.
1153</p>
1154</dd>
1155</dl></div>
1156<div class="paragraph"><p>Some actions require or allow to specify two revisions, and sometimes even two
1157pathnames. In most general form such path_info (component) based gitweb URL
1158looks like this:</p></div>
1159<div class="listingblock">
1160<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531161<pre><code>.../gitweb.cgi/&lt;repo&gt;/&lt;action&gt;/&lt;revision_from&gt;:/&lt;path_from&gt;..&lt;revision_to&gt;:/&lt;path_to&gt;?&lt;arguments&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091162</div></div>
1163<div class="paragraph"><p>Each action is implemented as a subroutine, and must be present in %actions
1164hash. Some actions are disabled by default, and must be turned on via feature
1165mechanism. For example to enable <em>blame</em> view add the following to gitweb
1166configuration file:</p></div>
1167<div class="listingblock">
1168<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531169<pre><code>$feature{'blame'}{'default'} = [1];</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091170</div></div>
Junio C Hamano9d971152012-12-19 00:43:111171<div class="sect2">
1172<h3 id="_actions">Actions:</h3>
Junio C Hamano11821ed2011-10-19 18:42:091173<div class="paragraph"><p>The standard actions are:</p></div>
1174<div class="dlist"><dl>
1175<dt class="hdlist1">
1176project_list
1177</dt>
1178<dd>
1179<p>
1180 Lists the available Git repositories. This is the default command if no
1181 repository is specified in the URL.
1182</p>
1183</dd>
1184<dt class="hdlist1">
1185summary
1186</dt>
1187<dd>
1188<p>
1189 Displays summary about given repository. This is the default command if
1190 no action is specified in URL, and only repository is specified.
1191</p>
1192</dd>
1193<dt class="hdlist1">
1194heads
1195</dt>
1196<dt class="hdlist1">
1197remotes
1198</dt>
1199<dd>
1200<p>
1201 Lists all local or all remote-tracking branches in given repository.
1202</p>
1203<div class="paragraph"><p>The latter is not available by default, unless configured.</p></div>
1204</dd>
1205<dt class="hdlist1">
1206tags
1207</dt>
1208<dd>
1209<p>
1210 List all tags (lightweight and annotated) in given repository.
1211</p>
1212</dd>
1213<dt class="hdlist1">
1214blob
1215</dt>
1216<dt class="hdlist1">
1217tree
1218</dt>
1219<dd>
1220<p>
1221 Shows the files and directories in a given repository path, at given
1222 revision. This is default command if no action is specified in the URL,
1223 and path is given.
1224</p>
1225</dd>
1226<dt class="hdlist1">
1227blob_plain
1228</dt>
1229<dd>
1230<p>
1231 Returns the raw data for the file in given repository, at given path and
1232 revision. Links to this action are marked <em>raw</em>.
1233</p>
1234</dd>
1235<dt class="hdlist1">
1236blobdiff
1237</dt>
1238<dd>
1239<p>
1240 Shows the difference between two revisions of the same file.
1241</p>
1242</dd>
1243<dt class="hdlist1">
1244blame
1245</dt>
1246<dt class="hdlist1">
1247blame_incremental
1248</dt>
1249<dd>
1250<p>
1251 Shows the blame (also called annotation) information for a file. On a
1252 per line basis it shows the revision in which that line was last changed
1253 and the user that committed the change. The incremental version (which
1254 if configured is used automatically when JavaScript is enabled) uses
1255 Ajax to incrementally add blame info to the contents of given file.
1256</p>
1257<div class="paragraph"><p>This action is disabled by default for performance reasons.</p></div>
1258</dd>
1259<dt class="hdlist1">
1260commit
1261</dt>
1262<dt class="hdlist1">
1263commitdiff
1264</dt>
1265<dd>
1266<p>
1267 Shows information about a specific commit in a repository. The <em>commit</em>
1268 view shows information about commit in more detail, the <em>commitdiff</em>
1269 action shows changeset for given commit.
1270</p>
1271</dd>
1272<dt class="hdlist1">
1273patch
1274</dt>
1275<dd>
1276<p>
1277 Returns the commit in plain text mail format, suitable for applying with
Junio C Hamanoa28a9202012-06-21 07:08:231278 <a href="git-am.html">git-am(1)</a>.
Junio C Hamano11821ed2011-10-19 18:42:091279</p>
1280</dd>
1281<dt class="hdlist1">
1282tag
1283</dt>
1284<dd>
1285<p>
1286 Display specific annotated tag (tag object).
1287</p>
1288</dd>
1289<dt class="hdlist1">
1290log
1291</dt>
1292<dt class="hdlist1">
1293shortlog
1294</dt>
1295<dd>
1296<p>
1297 Shows log information (commit message or just commit subject) for a
1298 given branch (starting from given revision).
1299</p>
1300<div class="paragraph"><p>The <em>shortlog</em> view is more compact; it shows one commit per line.</p></div>
1301</dd>
1302<dt class="hdlist1">
1303history
1304</dt>
1305<dd>
1306<p>
1307 Shows history of the file or directory in a given repository path,
1308 starting from given revision (defaults to HEAD, i.e. default branch).
1309</p>
1310<div class="paragraph"><p>This view is similar to <em>shortlog</em> view.</p></div>
1311</dd>
1312<dt class="hdlist1">
1313rss
1314</dt>
1315<dt class="hdlist1">
1316atom
1317</dt>
1318<dd>
1319<p>
1320 Generates an RSS (or Atom) feed of changes to repository.
1321</p>
1322</dd>
1323</dl></div>
1324</div>
Junio C Hamano9d971152012-12-19 00:43:111325</div>
1326</div>
1327<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:091328<h2 id="_webserver_configuration">WEBSERVER CONFIGURATION</h2>
1329<div class="sectionbody">
1330<div class="paragraph"><p>This section explains how to configure some common webservers to run gitweb. In
Junio C Hamanoc14e6ad2014-10-31 20:25:531331all cases, <code>/path/to/gitweb</code> in the examples is the directory you ran installed
1332gitweb in, and contains <code>gitweb_config.perl</code>.</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091333<div class="paragraph"><p>If you&#8217;ve configured a web server that isn&#8217;t listed here for gitweb, please send
1334in the instructions so they can be included in a future release.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111335<div class="sect2">
1336<h3 id="_apache_as_cgi">Apache as CGI</h3>
Junio C Hamano11821ed2011-10-19 18:42:091337<div class="paragraph"><p>Apache must be configured to support CGI scripts in the directory in
Junio C Hamanob5513772019-04-22 03:38:391338which gitweb is installed. Let&#8217;s assume that it is <code>/var/www/cgi-bin</code>
Junio C Hamano11821ed2011-10-19 18:42:091339directory.</p></div>
1340<div class="listingblock">
1341<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531342<pre><code>ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
Junio C Hamano11821ed2011-10-19 18:42:091343
1344&lt;Directory "/var/www/cgi-bin"&gt;
1345 Options Indexes FollowSymlinks ExecCGI
1346 AllowOverride None
1347 Order allow,deny
1348 Allow from all
Junio C Hamanoc14e6ad2014-10-31 20:25:531349&lt;/Directory&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091350</div></div>
1351<div class="paragraph"><p>With that configuration the full path to browse repositories would be:</p></div>
1352<div class="literalblock">
1353<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531354<pre><code>http://server/cgi-bin/gitweb.cgi</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091355</div></div>
Junio C Hamano9d971152012-12-19 00:43:111356</div>
1357<div class="sect2">
1358<h3 id="_apache_with_mod_perl_via_modperl_registry">Apache with mod_perl, via ModPerl::Registry</h3>
Junio C Hamano11821ed2011-10-19 18:42:091359<div class="paragraph"><p>You can use mod_perl with gitweb. You must install Apache::Registry
1360(for mod_perl 1.x) or ModPerl::Registry (for mod_perl 2.x) to enable
1361this support.</p></div>
Junio C Hamanob5513772019-04-22 03:38:391362<div class="paragraph"><p>Assuming that gitweb is installed to <code>/var/www/perl</code>, the following
Junio C Hamano11821ed2011-10-19 18:42:091363Apache configuration (for mod_perl 2.x) is suitable.</p></div>
1364<div class="listingblock">
1365<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531366<pre><code>Alias /perl "/var/www/perl"
Junio C Hamano11821ed2011-10-19 18:42:091367
1368&lt;Directory "/var/www/perl"&gt;
1369 SetHandler perl-script
1370 PerlResponseHandler ModPerl::Registry
1371 PerlOptions +ParseHeaders
1372 Options Indexes FollowSymlinks +ExecCGI
1373 AllowOverride None
1374 Order allow,deny
1375 Allow from all
Junio C Hamanoc14e6ad2014-10-31 20:25:531376&lt;/Directory&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091377</div></div>
1378<div class="paragraph"><p>With that configuration the full path to browse repositories would be:</p></div>
1379<div class="literalblock">
1380<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531381<pre><code>http://server/perl/gitweb.cgi</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091382</div></div>
Junio C Hamano9d971152012-12-19 00:43:111383</div>
1384<div class="sect2">
1385<h3 id="_apache_with_fastcgi">Apache with FastCGI</h3>
Junio C Hamano11821ed2011-10-19 18:42:091386<div class="paragraph"><p>Gitweb works with Apache and FastCGI. First you need to rename, copy
1387or symlink gitweb.cgi to gitweb.fcgi. Let&#8217;s assume that gitweb is
Junio C Hamanob5513772019-04-22 03:38:391388installed in <code>/usr/share/gitweb</code> directory. The following Apache
Junio C Hamano11821ed2011-10-19 18:42:091389configuration is suitable (UNTESTED!)</p></div>
1390<div class="listingblock">
1391<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531392<pre><code>FastCgiServer /usr/share/gitweb/gitweb.cgi
Junio C Hamano11821ed2011-10-19 18:42:091393ScriptAlias /gitweb /usr/share/gitweb/gitweb.cgi
1394
1395Alias /gitweb/static /usr/share/gitweb/static
1396&lt;Directory /usr/share/gitweb/static&gt;
1397 SetHandler default-handler
Junio C Hamanoc14e6ad2014-10-31 20:25:531398&lt;/Directory&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091399</div></div>
1400<div class="paragraph"><p>With that configuration the full path to browse repositories would be:</p></div>
1401<div class="literalblock">
1402<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531403<pre><code>http://server/gitweb</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091404</div></div>
1405</div>
Junio C Hamano9d971152012-12-19 00:43:111406</div>
1407</div>
1408<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:091409<h2 id="_advanced_web_server_setup">ADVANCED WEB SERVER SETUP</h2>
1410<div class="sectionbody">
Junio C Hamanoc14e6ad2014-10-31 20:25:531411<div class="paragraph"><p>All of those examples use request rewriting, and need <code>mod_rewrite</code>
Junio C Hamano11821ed2011-10-19 18:42:091412(or equivalent; examples below are written for Apache).</p></div>
Junio C Hamano9d971152012-12-19 00:43:111413<div class="sect2">
1414<h3 id="_single_url_for_gitweb_and_for_fetching">Single URL for gitweb and for fetching</h3>
Junio C Hamanoc14e6ad2014-10-31 20:25:531415<div class="paragraph"><p>If you want to have one URL for both gitweb and your <code>http://</code>
Junio C Hamano11821ed2011-10-19 18:42:091416repositories, you can configure Apache like this:</p></div>
1417<div class="listingblock">
1418<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531419<pre><code>&lt;VirtualHost *:80&gt;
Junio C Hamano11821ed2011-10-19 18:42:091420 ServerName git.example.org
1421 DocumentRoot /pub/git
1422 SetEnv GITWEB_CONFIG /etc/gitweb.conf
1423
1424 # turning on mod rewrite
1425 RewriteEngine on
1426
1427 # make the front page an internal rewrite to the gitweb script
1428 RewriteRule ^/$ /cgi-bin/gitweb.cgi
1429
1430 # make access for "dumb clients" work
1431 RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ \
1432 /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
Junio C Hamanoc14e6ad2014-10-31 20:25:531433&lt;/VirtualHost&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091434</div></div>
1435<div class="paragraph"><p>The above configuration expects your public repositories to live under
Junio C Hamanob5513772019-04-22 03:38:391436<code>/pub/git</code> and will serve them as <code>http://git.domain.org/dir-under-pub-git</code>,
Junio C Hamanod7fccbf2013-07-25 03:24:571437both as clonable Git URL and as browseable gitweb interface. If you then
Junio C Hamanoc14e6ad2014-10-31 20:25:531438start your <a href="git-daemon.html">git-daemon(1)</a> with <code>--base-path=/pub/git --export-all</code>
1439then you can even use the <code>git://</code> URL with exactly the same path.</p></div>
1440<div class="paragraph"><p>Setting the environment variable <code>GITWEB_CONFIG</code> will tell gitweb to use the
Junio C Hamanob5513772019-04-22 03:38:391441named file (i.e. in this example <code>/etc/gitweb.conf</code>) as a configuration for
Junio C Hamano11821ed2011-10-19 18:42:091442gitweb. You don&#8217;t really need it in above example; it is required only if
1443your configuration file is in different place than built-in (during
Junio C Hamanob5513772019-04-22 03:38:391444compiling gitweb) <em>gitweb_config.perl</em> or <code>/etc/gitweb.conf</code>. See
Junio C Hamanoa28a9202012-06-21 07:08:231445<a href="gitweb.conf.html">gitweb.conf(5)</a> for details, especially information about precedence
Junio C Hamano11821ed2011-10-19 18:42:091446rules.</p></div>
1447<div class="paragraph"><p>If you use the rewrite rules from the example you <strong>might</strong> also need
1448something like the following in your gitweb configuration file
Junio C Hamanob5513772019-04-22 03:38:391449(<code>/etc/gitweb.conf</code> following example):</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091450<div class="listingblock">
1451<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531452<pre><code>@stylesheets = ("/some/absolute/path/gitweb.css");
Junio C Hamano11821ed2011-10-19 18:42:091453$my_uri = "/";
1454$home_link = "/";
Junio C Hamanoc14e6ad2014-10-31 20:25:531455$per_request_config = 1;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091456</div></div>
1457<div class="paragraph"><p>Nowadays though gitweb should create HTML base tag when needed (to set base
1458URI for relative links), so it should work automatically.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111459</div>
1460<div class="sect2">
1461<h3 id="_webserver_configuration_with_multiple_projects_root">Webserver configuration with multiple projects' root</h3>
Junio C Hamano11821ed2011-10-19 18:42:091462<div class="paragraph"><p>If you want to use gitweb with several project roots you can edit your
1463Apache virtual host and gitweb configuration files in the following way.</p></div>
1464<div class="paragraph"><p>The virtual host configuration (in Apache configuration file) should look
1465like this:</p></div>
1466<div class="listingblock">
1467<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531468<pre><code>&lt;VirtualHost *:80&gt;
Junio C Hamano11821ed2011-10-19 18:42:091469 ServerName git.example.org
1470 DocumentRoot /pub/git
1471 SetEnv GITWEB_CONFIG /etc/gitweb.conf
1472
1473 # turning on mod rewrite
1474 RewriteEngine on
1475
1476 # make the front page an internal rewrite to the gitweb script
1477 RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]
1478
1479 # look for a public_git folder in unix users' home
1480 # http://git.example.org/~&lt;user&gt;/
1481 RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1482 [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
1483
1484 # http://git.example.org/+&lt;user&gt;/
1485 #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1486 [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
1487
1488 # http://git.example.org/user/&lt;user&gt;/
1489 #RewriteRule ^/user/([^\/]+)/(gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1490 [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
1491
1492 # defined list of project roots
1493 RewriteRule ^/scm(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1494 [QSA,E=GITWEB_PROJECTROOT:/pub/scm/,L,PT]
1495 RewriteRule ^/var(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1496 [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]
1497
1498 # make access for "dumb clients" work
1499 RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ \
1500 /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
Junio C Hamanoc14e6ad2014-10-31 20:25:531501&lt;/VirtualHost&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091502</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531503<div class="paragraph"><p>Here actual project root is passed to gitweb via <code>GITWEB_PROJECT_ROOT</code>
Junio C Hamano11821ed2011-10-19 18:42:091504environment variable from a web server, so you need to put the following
Junio C Hamanob5513772019-04-22 03:38:391505line in gitweb configuration file (<code>/etc/gitweb.conf</code> in above example):</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091506<div class="listingblock">
1507<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531508<pre><code>$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/pub/git";</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091509</div></div>
1510<div class="paragraph"><p><strong>Note</strong> that this requires to be set for each request, so either
Junio C Hamanoc14e6ad2014-10-31 20:25:531511<code>$per_request_config</code> must be false, or the above must be put in code
1512referenced by <code>$per_request_config</code>;</p></div>
1513<div class="paragraph"><p>These configurations enable two things. First, each unix user (<code>&lt;user&gt;</code>) of
Junio C Hamano076ffcc2013-02-06 05:13:211514the server will be able to browse through gitweb Git repositories found in
Junio C Hamanob5513772019-04-22 03:38:391515<code>~/public_git/</code> with the following url:</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091516<div class="literalblock">
1517<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531518<pre><code>http://git.example.org/~&lt;user&gt;/</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091519</div></div>
1520<div class="paragraph"><p>If you do not want this feature on your server just remove the second
1521rewrite rule.</p></div>
1522<div class="paragraph"><p>If you already use &#8216;mod_userdir` in your virtual host or you don&#8217;t want to
1523use the '~&#8217; as first character, just comment or remove the second rewrite
1524rule, and uncomment one of the following according to what you want.</p></div>
Junio C Hamanob5513772019-04-22 03:38:391525<div class="paragraph"><p>Second, repositories found in <code>/pub/scm/</code> and <code>/var/git/</code> will be accessible
Junio C Hamanoc14e6ad2014-10-31 20:25:531526through <code>http://git.example.org/scm/</code> and <code>http://git.example.org/var/</code>.
Junio C Hamano11821ed2011-10-19 18:42:091527You can add as many project roots as you want by adding rewrite rules like
1528the third and the fourth.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111529</div>
1530<div class="sect2">
1531<h3 id="_path_info_usage">PATH_INFO usage</h3>
Junio C Hamano11821ed2011-10-19 18:42:091532<div class="paragraph"><p>If you enable PATH_INFO usage in gitweb by putting</p></div>
1533<div class="listingblock">
1534<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531535<pre><code>$feature{'pathinfo'}{'default'} = [1];</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091536</div></div>
1537<div class="paragraph"><p>in your gitweb configuration file, it is possible to set up your server so
1538that it consumes and produces URLs in the form</p></div>
1539<div class="literalblock">
1540<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531541<pre><code>http://git.example.com/project.git/shortlog/sometag</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091542</div></div>
1543<div class="paragraph"><p>i.e. without <em>gitweb.cgi</em> part, by using a configuration such as the
Junio C Hamanob5513772019-04-22 03:38:391544following. This configuration assumes that <code>/var/www/gitweb</code> is the
Junio C Hamano11821ed2011-10-19 18:42:091545DocumentRoot of your webserver, contains the gitweb.cgi script and
1546complementary static files (stylesheet, favicon, JavaScript):</p></div>
1547<div class="listingblock">
1548<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531549<pre><code>&lt;VirtualHost *:80&gt;
Junio C Hamano11821ed2011-10-19 18:42:091550 ServerAlias git.example.com
1551
1552 DocumentRoot /var/www/gitweb
1553
1554 &lt;Directory /var/www/gitweb&gt;
1555 Options ExecCGI
1556 AddHandler cgi-script cgi
1557
1558 DirectoryIndex gitweb.cgi
1559
1560 RewriteEngine On
1561 RewriteCond %{REQUEST_FILENAME} !-f
1562 RewriteCond %{REQUEST_FILENAME} !-d
1563 RewriteRule ^.* /gitweb.cgi/$0 [L,PT]
1564 &lt;/Directory&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:531565&lt;/VirtualHost&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091566</div></div>
1567<div class="paragraph"><p>The rewrite rule guarantees that existing static files will be properly
1568served, whereas any other URL will be passed to gitweb as PATH_INFO
1569parameter.</p></div>
1570<div class="paragraph"><p><strong>Notice</strong> that in this case you don&#8217;t need special settings for
Junio C Hamanoc14e6ad2014-10-31 20:25:531571<code>@stylesheets</code>, <code>$my_uri</code> and <code>$home_link</code>, but you lose "dumb client"
Junio C Hamano11821ed2011-10-19 18:42:091572access to your project .git dirs (described in "Single URL for gitweb and
1573for fetching" section). A possible workaround for the latter is the
Junio C Hamanob5513772019-04-22 03:38:391574following: in your project root dir (e.g. <code>/pub/git</code>) have the projects
1575named <strong>without</strong> a .git extension (e.g. <code>/pub/git/project</code> instead of
1576<code>/pub/git/project.git</code>) and configure Apache as follows:</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091577<div class="listingblock">
1578<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531579<pre><code>&lt;VirtualHost *:80&gt;
Junio C Hamano11821ed2011-10-19 18:42:091580 ServerAlias git.example.com
1581
1582 DocumentRoot /var/www/gitweb
1583
1584 AliasMatch ^(/.*?)(\.git)(/.*)?$ /pub/git$1$3
1585 &lt;Directory /var/www/gitweb&gt;
1586 Options ExecCGI
1587 AddHandler cgi-script cgi
1588
1589 DirectoryIndex gitweb.cgi
1590
1591 RewriteEngine On
1592 RewriteCond %{REQUEST_FILENAME} !-f
1593 RewriteCond %{REQUEST_FILENAME} !-d
1594 RewriteRule ^.* /gitweb.cgi/$0 [L,PT]
1595 &lt;/Directory&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:531596&lt;/VirtualHost&gt;</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091597</div></div>
1598<div class="paragraph"><p>The additional AliasMatch makes it so that</p></div>
1599<div class="literalblock">
1600<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531601<pre><code>http://git.example.com/project.git</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091602</div></div>
Junio C Hamano076ffcc2013-02-06 05:13:211603<div class="paragraph"><p>will give raw access to the project&#8217;s Git dir (so that the project can be
Junio C Hamano11821ed2011-10-19 18:42:091604cloned), while</p></div>
1605<div class="literalblock">
1606<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531607<pre><code>http://git.example.com/project</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091608</div></div>
1609<div class="paragraph"><p>will provide human-friendly gitweb access.</p></div>
1610<div class="paragraph"><p>This solution is not 100% bulletproof, in the sense that if some project has
Junio C Hamanob5513772019-04-22 03:38:391611a named ref (branch, tag) starting with <code>git/</code>, then paths such as</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091612<div class="literalblock">
1613<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531614<pre><code>http://git.example.com/project/command/abranch..git/abranch</code></pre>
Junio C Hamano11821ed2011-10-19 18:42:091615</div></div>
1616<div class="paragraph"><p>will fail with a 404 error.</p></div>
1617</div>
Junio C Hamano9d971152012-12-19 00:43:111618</div>
1619</div>
1620<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:091621<h2 id="_bugs">BUGS</h2>
1622<div class="sectionbody">
1623<div class="paragraph"><p>Please report any bugs or feature requests to <a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>,
1624putting "gitweb" in the subject of email.</p></div>
1625</div>
Junio C Hamano9d971152012-12-19 00:43:111626</div>
1627<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:091628<h2 id="_see_also">SEE ALSO</h2>
1629<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231630<div class="paragraph"><p><a href="gitweb.conf.html">gitweb.conf(5)</a>, <a href="git-instaweb.html">git-instaweb(1)</a></p></div>
Junio C Hamanob5513772019-04-22 03:38:391631<div class="paragraph"><p><code>gitweb/README</code>, <code>gitweb/INSTALL</code></p></div>
Junio C Hamano11821ed2011-10-19 18:42:091632</div>
Junio C Hamano9d971152012-12-19 00:43:111633</div>
1634<div class="sect1">
Junio C Hamano11821ed2011-10-19 18:42:091635<h2 id="_git">GIT</h2>
1636<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231637<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano11821ed2011-10-19 18:42:091638</div>
1639</div>
Junio C Hamano9d971152012-12-19 00:43:111640</div>
Junio C Hamano11821ed2011-10-19 18:42:091641<div id="footnotes"><hr /></div>
1642<div id="footer">
1643<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531644Last updated
Junio C Hamano4078a552021-04-30 06:08:101645 2020-03-11 00:03:13 JST
Junio C Hamano11821ed2011-10-19 18:42:091646</div>
1647</div>
1648</body>
1649</html>