1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!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">
6 <meta http-equiv=
"Content-Type" content=
"application/xhtml+xml; charset=UTF-8" />
7 <meta name=
"generator" content=
"AsciiDoc 10.2.0" />
8 <title>gitweb(
1)
</title>
9 <style type=
"text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.5em;
129 margin-bottom:
1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
228 div.imageblock div.content { padding-left:
0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size:
2em; }
411 span.small { font-size:
0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
443 div.tableblock
> table[
frame=
"hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock
> table[
frame=
"vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
480 border-color: #
527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-top {
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September
2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
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.
558 /* modified by Troy D. Hanson, September
2006. License: GPL */
559 /* modified by Stuart Rackham,
2006,
2009. License: GPL */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([
1-'+(toclevels+
1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
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);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
610 for (i =
0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute(
"class")
614 && entry.getAttribute(
"class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i =
0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 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");
632 div.className =
"toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length ==
0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/
2005/
07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
651 var noteholder = document.getElementById(
"footnotes");
655 var entriesToRemove = [];
656 for (i =
0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute(
"class") ==
"footnote")
659 entriesToRemove.push(entry);
661 for (i =
0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById(
"content");
667 var spans = cont.getElementsByTagName(
"span");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-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];
679 "[<a id='_footnoteref_" + n +
"' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n +
"</a>]";
681 spans[i].setAttribute(
"data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n +
"'>" +
685 "<a href='#_footnoteref_" + n +
"' title='Return to text'>" +
686 n +
"</a>. " + note +
"</div>";
687 var id =spans[i].getAttribute(
"id");
688 if (id != null) refs[
"#"+id] = n;
692 noteholder.parentNode.removeChild(noteholder);
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.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 gitweb(
1) Manual Page
741 <div class=
"sectionbody">
743 Git web interface (web frontend to Git repositories)
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"paragraph"><p>To get started with gitweb, run
<a href=
"git-instaweb.html">git-instaweb(
1)
</a> from a Git repository.
752 This would configure and start your web server, and run web browser pointing to
757 <h2 id=
"_description">DESCRIPTION
</h2>
758 <div class=
"sectionbody">
759 <div class=
"paragraph"><p>Gitweb provides a web interface to Git repositories. Its features include:
</p></div>
760 <div class=
"ulist"><ul>
763 Viewing multiple Git repositories with common root.
768 Browsing every revision of the repository.
773 Viewing the contents of files in the repository at any revision.
778 Viewing the revision log of branches, history of files and directories,
779 see what was changed when, by who.
784 Viewing the blame/annotation details of any file (if enabled).
789 Generating RSS and Atom feeds of commits, for any branch.
790 The feeds are auto-discoverable in modern web browsers.
795 Viewing everything that was changed in a revision, and step through
796 revisions one at a time, viewing the history of the repository.
801 Finding commits which commit messages matches given search term.
805 <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,
806 browsed using gitweb itself.
</p></div>
810 <h2 id=
"_configuration">CONFIGURATION
</h2>
811 <div class=
"sectionbody">
812 <div class=
"paragraph"><p>Various aspects of gitweb
’s behavior can be controlled through the configuration
813 file
<code>gitweb_config.perl
</code> or
<code>/etc/gitweb.conf
</code>. See the
<a href=
"gitweb.conf.html">gitweb.conf(
5)
</a>
814 for details.
</p></div>
816 <h3 id=
"_repositories">Repositories
</h3>
817 <div class=
"paragraph"><p>Gitweb can show information from one or more Git repositories. These
818 repositories have to be all on local filesystem, and have to share common
819 repository root, i.e. be all under a single parent repository (but see also
820 "Advanced web server setup" section,
"Webserver configuration with multiple
821 projects' root" subsection).
</p></div>
822 <div class=
"listingblock">
823 <div class=
"content">
824 <pre><code>our $projectroot = '/path/to/parent/directory';
</code></pre>
826 <div class=
"paragraph"><p>The default value for
<code>$projectroot
</code> is
<code>/pub/git
</code>. You can change it during
827 building 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
829 to gitweb. The list of projects is generated by default by scanning the
830 <code>$projectroot
</code> directory for Git repositories (for object databases to be
831 more exact; gitweb is not interested in a working area, and is best suited
832 to showing
"bare" repositories).
</p></div>
833 <div class=
"paragraph"><p>The name of the repository in gitweb is the path to its
<code>$GIT_DIR
</code> (its object
834 database) relative to
<code>$projectroot
</code>. Therefore the repository $repo can be
835 found at
"$projectroot/$repo".
</p></div>
838 <h3 id=
"_projects_list_file_format">Projects list file format
</h3>
839 <div class=
"paragraph"><p>Instead of having gitweb find repositories by scanning filesystem
840 starting from $projectroot, you can provide a pre-generated list of
841 visible projects by setting
<code>$projects_list
</code> to point to a plain text
842 file 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>
847 One record (for project / repository) per line; does not support line
848 continuation (newline escaping).
853 Leading and trailing whitespace are ignored.
858 Whitespace separated fields; any run of whitespace can be used as field
859 separator (rules for Perl
’s
"<code>split(" ", $line)</code>").
864 Fields use modified URI encoding, defined in RFC
3986, section
2.1
865 (Percent-Encoding), or rather
"Query string encoding" (see
866 <a href=
"https://en.wikipedia.org/wiki/Query_string#URL_encoding">https://en.wikipedia.org/wiki/Query_string#URL_encoding
</a>), the difference
867 being that SP (
" ") can be encoded as
"+" (and therefore
"+" has to be
868 also percent-encoded).
870 <div class=
"paragraph"><p>Reserved characters are:
"%" (used for encoding),
"+" (can be used to
871 encode SPACE), all whitespace characters as defined in Perl, including SP,
872 TAB and LF, (used to separate fields in a record).
</p></div>
876 Currently recognized fields are:
878 <div class=
"dlist"><dl>
880 <repository path
>
884 path to repository GIT_DIR, relative to
<code>$projectroot
</code>
888 <repository owner
>
892 displayed as repository owner, preferably full name, or email,
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">
905 <pre><code>foo.git Joe+R+Hacker+
<joe@example.com
>
906 foo/bar.git O+W+Ner+
<owner@example.org
></code></pre>
908 <div class=
"paragraph"><p>By default this file controls only which projects are
<strong>visible
</strong> on projects
909 list page (note that entries that do not point to correctly recognized Git
910 repositories won
’t be displayed by gitweb). Even if a project is not
911 visible on projects list page, you can view it nevertheless by hand-crafting
912 a gitweb URL. By setting
<code>$strict_export
</code> configuration variable (see
913 <a href=
"gitweb.conf.html">gitweb.conf(
5)
</a>) to true value you can allow viewing only of
914 repositories also shown on the overview page (i.e. only projects explicitly
915 listed in projects list file will be accessible).
</p></div>
918 <h3 id=
"_generating_projects_list_using_gitweb">Generating projects list using gitweb
</h3>
919 <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">
923 <pre><code>read_config_file(
"gitweb_config.perl");
924 $projects_list = $projectroot;
</code></pre>
926 <div class=
"paragraph"><p>Then create the following script to get list of project in the format
927 suitable for GITWEB_LIST build configuration variable (or
928 <code>$projects_list
</code> variable in gitweb config):
</p></div>
929 <div class=
"listingblock">
930 <div class=
"content">
933 export
GITWEB_CONFIG=
"gitweb_make_index.perl"
934 export
GATEWAY_INTERFACE=
"CGI/1.1"
935 export
HTTP_ACCEPT=
"*/*"
936 export
REQUEST_METHOD=
"GET"
937 export
QUERY_STRING=
"a=project_index"
939 perl -- /var/www/cgi-bin/gitweb.cgi
</code></pre>
941 <div class=
"paragraph"><p>Run this script and save its output to a file. This file could then be used
942 as projects list file, which means that you can set
<code>$projects_list
</code> to its
946 <h3 id=
"_controlling_access_to_git_repositories">Controlling access to Git repositories
</h3>
947 <div class=
"paragraph"><p>By default all Git repositories under
<code>$projectroot
</code> are visible and
948 available to gitweb. You can however configure how gitweb controls access
949 to repositories.
</p></div>
950 <div class=
"ulist"><ul>
953 As described in
"Projects list file format" section, you can control which
954 projects are
<strong>visible
</strong> by selectively including repositories in projects
955 list file, and setting
<code>$projects_list
</code> gitweb configuration variable to
956 point to it. With
<code>$strict_export
</code> set, projects list file can be used to
957 control which repositories are
<strong>available
</strong> as well.
962 You can configure gitweb to only list and allow viewing of the explicitly
963 exported repositories, via
<code>$export_ok
</code> variable in gitweb config file; see
964 <a href=
"gitweb.conf.html">gitweb.conf(
5)
</a> manpage. If it evaluates to true, gitweb shows
965 repositories only if this file named by
<code>$export_ok
</code> exists in its object
966 database (if directory has the magic file named
<code>$export_ok
</code>).
968 <div class=
"paragraph"><p>For example
<a href=
"git-daemon.html">git-daemon(
1)
</a> by default (unless
<code>--export-all
</code> option
969 is 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">
973 <pre><code>our $export_ok =
"git-daemon-export-ok";
</code></pre>
975 <div class=
"paragraph"><p>makes gitweb show and allow access only to those repositories that can be
976 fetched from via
<code>git://
</code> protocol.
</p></div>
980 Finally, it is possible to specify an arbitrary perl subroutine that will
981 be called for each repository to determine if it can be exported. The
982 subroutine receives an absolute path to the project (repository) as its only
983 parameter (i.e.
"$projectroot/$project").
985 <div class=
"paragraph"><p>For example, if you use mod_perl to run the script, and have dumb
986 HTTP protocol authentication configured for your repositories, you
987 can use the following hook to allow access only if the user is
988 authorized to read the files:
</p></div>
989 <div class=
"listingblock">
990 <div class=
"content">
991 <pre><code>$export_auth_hook = sub {
992 use Apache2::SubRequest ();
993 use Apache2::Const -compile =
> qw(HTTP_OK);
994 my $path =
"$_[0]/HEAD";
995 my $r = Apache2::RequestUtil-
>request;
996 my $sub = $r-
>lookup_file($path);
997 return $sub-
>filename eq $path
998 && $sub-
>status == Apache2::Const::HTTP_OK;
1005 <h3 id=
"_per_repository_gitweb_configuration">Per-repository gitweb configuration
</h3>
1006 <div class=
"paragraph"><p>You can configure individual repositories shown in gitweb by creating file
1007 in the
<code>GIT_DIR
</code> of Git repository, or by setting some repo configuration
1008 variable (in
<code>GIT_DIR/config
</code>, see
<a href=
"git-config.html">git-config(
1)
</a>).
</p></div>
1009 <div class=
"paragraph"><p>You can use the following files in repository:
</p></div>
1010 <div class=
"dlist"><dl>
1011 <dt class=
"hdlist1">
1016 A html file (HTML fragment) which is included on the gitweb project
1017 "summary" page inside
<code><div
></code> block element. You can use it for longer
1018 description of a project, to provide links (for example to project
’s
1019 homepage), etc. This is recognized only if XSS prevention is off
1020 (
<code>$prevent_xss
</code> is false, see
<a href=
"gitweb.conf.html">gitweb.conf(
5)
</a>); a way to include
1021 a README safely when XSS prevention is on may be worked out in the
1025 <dt class=
"hdlist1">
1026 description (or
<code>gitweb.description
</code>)
1030 Short (shortened to
<code>$projects_list_description_width
</code> in the projects
1031 list page, which is
25 characters by default; see
1032 <a href=
"gitweb.conf.html">gitweb.conf(
5)
</a>) single line description of a project (of a
1033 repository). Plain text file; HTML will be escaped. By default set to
1035 <div class=
"listingblock">
1036 <div class=
"content">
1037 <pre><code>Unnamed repository; edit this file to name it for gitweb.
</code></pre>
1039 <div class=
"paragraph"><p>from the template during repository creation, usually installed in
1040 <code>/usr/share/git-core/templates/
</code>. You can use the
<code>gitweb.description
</code> repo
1041 configuration variable, but the file takes precedence.
</p></div>
1043 <dt class=
"hdlist1">
1044 category (or
<code>gitweb.category
</code>)
1048 Singe line category of a project, used to group projects if
1049 <code>$projects_list_group_categories
</code> is enabled. By default (file and
1050 configuration variable absent), uncategorized projects are put in the
1051 <code>$project_list_default_category
</code> category. You can use the
1052 <code>gitweb.category
</code> repo configuration variable, but the file takes
1055 <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>
1058 <dt class=
"hdlist1">
1059 cloneurl (or multiple-valued
<code>gitweb.url
</code>)
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
1065 <code>gitweb.url
</code> repository configuration variable for that, but the file
1068 <div class=
"paragraph"><p>This is per-repository enhancement / version of global prefix-based
1069 <code>@git_base_url_list
</code> gitweb configuration variable (see
1070 <a href=
"gitweb.conf.html">gitweb.conf(
5)
</a>).
</p></div>
1072 <dt class=
"hdlist1">
1077 You can use the
<code>gitweb.owner
</code> repository configuration variable to set
1078 repository
’s owner. It is displayed in the project list and summary
1081 <div class=
"paragraph"><p>If it
’s not set, filesystem directory
’s owner is used (via GECOS field,
1082 i.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>
1084 points to file with list of repositories, then project owner defaults to
1085 value from this file for given repository.
</p></div>
1087 <dt class=
"hdlist1">
1088 various
<code>gitweb.*
</code> config variables (in config)
1092 Read description of
<code>%feature
</code> hash for detailed list, and descriptions.
1093 See also
"Configuring gitweb features" section in
<a href=
"gitweb.conf.html">gitweb.conf(
5)
</a>
1101 <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
1104 information via query parameters. The typical gitweb URLs are broken down in to
1105 five components:
</p></div>
1106 <div class=
"listingblock">
1107 <div class=
"content">
1108 <pre><code>.../gitweb.cgi/
<repo
>/
<action
>/
<revision
>:/
<path
>?
<arguments
></code></pre>
1110 <div class=
"dlist"><dl>
1111 <dt class=
"hdlist1">
1116 The repository the action will be performed on.
1118 <div class=
"paragraph"><p>All actions except for those that list all available projects,
1119 in whatever form, require this parameter.
</p></div>
1121 <dt class=
"hdlist1">
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.
1130 <dt class=
"hdlist1">
1135 Revision shown. Defaults to HEAD.
1138 <dt class=
"hdlist1">
1143 The path within the
<repository
> that the action is performed on,
1144 for those actions that require it.
1147 <dt class=
"hdlist1">
1152 Any arguments that control the behaviour of the action.
1156 <div class=
"paragraph"><p>Some actions require or allow to specify two revisions, and sometimes even two
1157 pathnames. In most general form such path_info (component) based gitweb URL
1158 looks like this:
</p></div>
1159 <div class=
"listingblock">
1160 <div class=
"content">
1161 <pre><code>.../gitweb.cgi/
<repo
>/
<action
>/
<revision_from
>:/
<path_from
>..
<revision_to
>:/
<path_to
>?
<arguments
></code></pre>
1163 <div class=
"paragraph"><p>Each action is implemented as a subroutine, and must be present in %actions
1164 hash. Some actions are disabled by default, and must be turned on via feature
1165 mechanism. For example to enable
<em>blame
</em> view add the following to gitweb
1166 configuration file:
</p></div>
1167 <div class=
"listingblock">
1168 <div class=
"content">
1169 <pre><code>$feature{'blame'}{'default'} = [
1];
</code></pre>
1172 <h3 id=
"_actions">Actions:
</h3>
1173 <div class=
"paragraph"><p>The standard actions are:
</p></div>
1174 <div class=
"dlist"><dl>
1175 <dt class=
"hdlist1">
1180 Lists the available Git repositories. This is the default command if no
1181 repository is specified in the URL.
1184 <dt class=
"hdlist1">
1189 Displays summary about given repository. This is the default command if
1190 no action is specified in URL, and only repository is specified.
1193 <dt class=
"hdlist1">
1196 <dt class=
"hdlist1">
1201 Lists all local or all remote-tracking branches in given repository.
1203 <div class=
"paragraph"><p>The latter is not available by default, unless configured.
</p></div>
1205 <dt class=
"hdlist1">
1210 List all tags (lightweight and annotated) in given repository.
1213 <dt class=
"hdlist1">
1216 <dt class=
"hdlist1">
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,
1226 <dt class=
"hdlist1">
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>.
1235 <dt class=
"hdlist1">
1240 Shows the difference between two revisions of the same file.
1243 <dt class=
"hdlist1">
1246 <dt class=
"hdlist1">
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.
1257 <div class=
"paragraph"><p>This action is disabled by default for performance reasons.
</p></div>
1259 <dt class=
"hdlist1">
1262 <dt class=
"hdlist1">
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.
1272 <dt class=
"hdlist1">
1277 Returns the commit in plain text mail format, suitable for applying with
1278 <a href=
"git-am.html">git-am(
1)
</a>.
1281 <dt class=
"hdlist1">
1286 Display specific annotated tag (tag object).
1289 <dt class=
"hdlist1">
1292 <dt class=
"hdlist1">
1297 Shows log information (commit message or just commit subject) for a
1298 given branch (starting from given revision).
1300 <div class=
"paragraph"><p>The
<em>shortlog
</em> view is more compact; it shows one commit per line.
</p></div>
1302 <dt class=
"hdlist1">
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).
1310 <div class=
"paragraph"><p>This view is similar to
<em>shortlog
</em> view.
</p></div>
1312 <dt class=
"hdlist1">
1315 <dt class=
"hdlist1">
1320 Generates an RSS (or Atom) feed of changes to repository.
1328 <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
1331 all cases,
<code>/path/to/gitweb
</code> in the examples is the directory you ran installed
1332 gitweb in, and contains
<code>gitweb_config.perl
</code>.
</p></div>
1333 <div class=
"paragraph"><p>If you
’ve configured a web server that isn
’t listed here for gitweb, please send
1334 in the instructions so they can be included in a future release.
</p></div>
1336 <h3 id=
"_apache_as_cgi">Apache as CGI
</h3>
1337 <div class=
"paragraph"><p>Apache must be configured to support CGI scripts in the directory in
1338 which gitweb is installed. Let
’s assume that it is
<code>/var/www/cgi-bin
</code>
1339 directory.
</p></div>
1340 <div class=
"listingblock">
1341 <div class=
"content">
1342 <pre><code>ScriptAlias /cgi-bin/
"/var/www/cgi-bin/"
1344 <Directory
"/var/www/cgi-bin">
1345 Options Indexes FollowSymlinks ExecCGI
1349 </Directory
></code></pre>
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">
1354 <pre><code>http://server/cgi-bin/gitweb.cgi
</code></pre>
1358 <h3 id=
"_apache_with_mod_perl_via_modperl_registry">Apache with mod_perl, via ModPerl::Registry
</h3>
1359 <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
1361 this support.
</p></div>
1362 <div class=
"paragraph"><p>Assuming that gitweb is installed to
<code>/var/www/perl
</code>, the following
1363 Apache configuration (for mod_perl
2.x) is suitable.
</p></div>
1364 <div class=
"listingblock">
1365 <div class=
"content">
1366 <pre><code>Alias /perl
"/var/www/perl"
1368 <Directory
"/var/www/perl">
1369 SetHandler perl-script
1370 PerlResponseHandler ModPerl::Registry
1371 PerlOptions +ParseHeaders
1372 Options Indexes FollowSymlinks +ExecCGI
1376 </Directory
></code></pre>
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">
1381 <pre><code>http://server/perl/gitweb.cgi
</code></pre>
1385 <h3 id=
"_apache_with_fastcgi">Apache with FastCGI
</h3>
1386 <div class=
"paragraph"><p>Gitweb works with Apache and FastCGI. First you need to rename, copy
1387 or symlink gitweb.cgi to gitweb.fcgi. Let
’s assume that gitweb is
1388 installed in
<code>/usr/share/gitweb
</code> directory. The following Apache
1389 configuration is suitable (UNTESTED!)
</p></div>
1390 <div class=
"listingblock">
1391 <div class=
"content">
1392 <pre><code>FastCgiServer /usr/share/gitweb/gitweb.cgi
1393 ScriptAlias /gitweb /usr/share/gitweb/gitweb.cgi
1395 Alias /gitweb/static /usr/share/gitweb/static
1396 <Directory /usr/share/gitweb/static
>
1397 SetHandler default-handler
1398 </Directory
></code></pre>
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">
1403 <pre><code>http://server/gitweb
</code></pre>
1409 <h2 id=
"_advanced_web_server_setup">ADVANCED WEB SERVER SETUP
</h2>
1410 <div class=
"sectionbody">
1411 <div class=
"paragraph"><p>All of those examples use request rewriting, and need
<code>mod_rewrite
</code>
1412 (or equivalent; examples below are written for Apache).
</p></div>
1414 <h3 id=
"_single_url_for_gitweb_and_for_fetching">Single URL for gitweb and for fetching
</h3>
1415 <div class=
"paragraph"><p>If you want to have one URL for both gitweb and your
<code>http://
</code>
1416 repositories, you can configure Apache like this:
</p></div>
1417 <div class=
"listingblock">
1418 <div class=
"content">
1419 <pre><code><VirtualHost *:
80>
1420 ServerName git.example.org
1421 DocumentRoot /pub/git
1422 SetEnv GITWEB_CONFIG /etc/gitweb.conf
1424 # turning on mod rewrite
1427 # make the front page an internal rewrite to the gitweb script
1428 RewriteRule ^/$ /cgi-bin/gitweb.cgi
1430 # make access for
"dumb clients" work
1431 RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ \
1432 /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
1433 </VirtualHost
></code></pre>
1435 <div class=
"paragraph"><p>The above configuration expects your public repositories to live under
1436 <code>/pub/git
</code> and will serve them as
<code>http://git.domain.org/dir-under-pub-git
</code>,
1437 both as clonable Git URL and as browseable gitweb interface. If you then
1438 start your
<a href=
"git-daemon.html">git-daemon(
1)
</a> with
<code>--base-path=/pub/git --export-all
</code>
1439 then 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
1441 named file (i.e. in this example
<code>/etc/gitweb.conf
</code>) as a configuration for
1442 gitweb. You don
’t really need it in above example; it is required only if
1443 your configuration file is in different place than built-in (during
1444 compiling gitweb)
<em>gitweb_config.perl
</em> or
<code>/etc/gitweb.conf
</code>. See
1445 <a href=
"gitweb.conf.html">gitweb.conf(
5)
</a> for details, especially information about precedence
1447 <div class=
"paragraph"><p>If you use the rewrite rules from the example you
<strong>might
</strong> also need
1448 something like the following in your gitweb configuration file
1449 (
<code>/etc/gitweb.conf
</code> following example):
</p></div>
1450 <div class=
"listingblock">
1451 <div class=
"content">
1452 <pre><code>@stylesheets = (
"/some/absolute/path/gitweb.css");
1455 $per_request_config =
1;
</code></pre>
1457 <div class=
"paragraph"><p>Nowadays though gitweb should create HTML base tag when needed (to set base
1458 URI for relative links), so it should work automatically.
</p></div>
1461 <h3 id=
"_webserver_configuration_with_multiple_projects_root">Webserver configuration with multiple projects' root
</h3>
1462 <div class=
"paragraph"><p>If you want to use gitweb with several project roots you can edit your
1463 Apache 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
1465 like this:
</p></div>
1466 <div class=
"listingblock">
1467 <div class=
"content">
1468 <pre><code><VirtualHost *:
80>
1469 ServerName git.example.org
1470 DocumentRoot /pub/git
1471 SetEnv GITWEB_CONFIG /etc/gitweb.conf
1473 # turning on mod rewrite
1476 # make the front page an internal rewrite to the gitweb script
1477 RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]
1479 # look for a public_git directory in unix users' home
1480 # http://git.example.org/~
<user
>/
1481 RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1482 [QSA,E=GITWEB_PROJECTROOT:/home/$
1/public_git/,L,PT]
1484 # http://git.example.org/+
<user
>/
1485 #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1486 [QSA,E=GITWEB_PROJECTROOT:/home/$
1/public_git/,L,PT]
1488 # http://git.example.org/user/
<user
>/
1489 #RewriteRule ^/user/([^\/]+)/(gitweb.cgi)?$ /cgi-bin/gitweb.cgi \
1490 [QSA,E=GITWEB_PROJECTROOT:/home/$
1/public_git/,L,PT]
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]
1498 # make access for
"dumb clients" work
1499 RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ \
1500 /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
1501 </VirtualHost
></code></pre>
1503 <div class=
"paragraph"><p>Here actual project root is passed to gitweb via
<code>GITWEB_PROJECT_ROOT
</code>
1504 environment variable from a web server, so you need to put the following
1505 line in gitweb configuration file (
<code>/etc/gitweb.conf
</code> in above example):
</p></div>
1506 <div class=
"listingblock">
1507 <div class=
"content">
1508 <pre><code>$projectroot = $ENV{'GITWEB_PROJECTROOT'} ||
"/pub/git";
</code></pre>
1510 <div class=
"paragraph"><p><strong>Note
</strong> that this requires to be set for each request, so either
1511 <code>$per_request_config
</code> must be false, or the above must be put in code
1512 referenced by
<code>$per_request_config
</code>;
</p></div>
1513 <div class=
"paragraph"><p>These configurations enable two things. First, each unix user (
<code><user
></code>) of
1514 the server will be able to browse through gitweb Git repositories found in
1515 <code>~/public_git/
</code> with the following url:
</p></div>
1516 <div class=
"literalblock">
1517 <div class=
"content">
1518 <pre><code>http://git.example.org/~
<user
>/
</code></pre>
1520 <div class=
"paragraph"><p>If you do not want this feature on your server just remove the second
1521 rewrite rule.
</p></div>
1522 <div class=
"paragraph"><p>If you already use
‘mod_userdir` in your virtual host or you don
’t want to
1523 use the '~
’ as first character, just comment or remove the second rewrite
1524 rule, and uncomment one of the following according to what you want.
</p></div>
1525 <div class=
"paragraph"><p>Second, repositories found in
<code>/pub/scm/
</code> and
<code>/var/git/
</code> will be accessible
1526 through
<code>http://git.example.org/scm/
</code> and
<code>http://git.example.org/var/
</code>.
1527 You can add as many project roots as you want by adding rewrite rules like
1528 the third and the fourth.
</p></div>
1531 <h3 id=
"_path_info_usage">PATH_INFO usage
</h3>
1532 <div class=
"paragraph"><p>If you enable PATH_INFO usage in gitweb by putting
</p></div>
1533 <div class=
"listingblock">
1534 <div class=
"content">
1535 <pre><code>$feature{'pathinfo'}{'default'} = [
1];
</code></pre>
1537 <div class=
"paragraph"><p>in your gitweb configuration file, it is possible to set up your server so
1538 that it consumes and produces URLs in the form
</p></div>
1539 <div class=
"literalblock">
1540 <div class=
"content">
1541 <pre><code>http://git.example.com/project.git/shortlog/sometag
</code></pre>
1543 <div class=
"paragraph"><p>i.e. without
<em>gitweb.cgi
</em> part, by using a configuration such as the
1544 following. This configuration assumes that
<code>/var/www/gitweb
</code> is the
1545 DocumentRoot of your webserver, contains the gitweb.cgi script and
1546 complementary static files (stylesheet, favicon, JavaScript):
</p></div>
1547 <div class=
"listingblock">
1548 <div class=
"content">
1549 <pre><code><VirtualHost *:
80>
1550 ServerAlias git.example.com
1552 DocumentRoot /var/www/gitweb
1554 <Directory /var/www/gitweb
>
1556 AddHandler cgi-script cgi
1558 DirectoryIndex gitweb.cgi
1561 RewriteCond %{REQUEST_FILENAME} !-f
1562 RewriteCond %{REQUEST_FILENAME} !-d
1563 RewriteRule ^.* /gitweb.cgi/$
0 [L,PT]
1565 </VirtualHost
></code></pre>
1567 <div class=
"paragraph"><p>The rewrite rule guarantees that existing static files will be properly
1568 served, whereas any other URL will be passed to gitweb as PATH_INFO
1569 parameter.
</p></div>
1570 <div class=
"paragraph"><p><strong>Notice
</strong> that in this case you don
’t need special settings for
1571 <code>@stylesheets
</code>,
<code>$my_uri
</code> and
<code>$home_link
</code>, but you lose
"dumb client"
1572 access to your project .git dirs (described in
"Single URL for gitweb and
1573 for fetching" section). A possible workaround for the latter is the
1574 following: in your project root dir (e.g.
<code>/pub/git
</code>) have the projects
1575 named
<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>
1577 <div class=
"listingblock">
1578 <div class=
"content">
1579 <pre><code><VirtualHost *:
80>
1580 ServerAlias git.example.com
1582 DocumentRoot /var/www/gitweb
1584 AliasMatch ^(/.*?)(\.git)(/.*)?$ /pub/git$
1$
3
1585 <Directory /var/www/gitweb
>
1587 AddHandler cgi-script cgi
1589 DirectoryIndex gitweb.cgi
1592 RewriteCond %{REQUEST_FILENAME} !-f
1593 RewriteCond %{REQUEST_FILENAME} !-d
1594 RewriteRule ^.* /gitweb.cgi/$
0 [L,PT]
1596 </VirtualHost
></code></pre>
1598 <div class=
"paragraph"><p>The additional AliasMatch makes it so that
</p></div>
1599 <div class=
"literalblock">
1600 <div class=
"content">
1601 <pre><code>http://git.example.com/project.git
</code></pre>
1603 <div class=
"paragraph"><p>will give raw access to the project
’s Git dir (so that the project can be
1604 cloned), while
</p></div>
1605 <div class=
"literalblock">
1606 <div class=
"content">
1607 <pre><code>http://git.example.com/project
</code></pre>
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
1611 a named ref (branch, tag) starting with
<code>git/
</code>, then paths such as
</p></div>
1612 <div class=
"literalblock">
1613 <div class=
"content">
1614 <pre><code>http://git.example.com/project/command/abranch..git/abranch
</code></pre>
1616 <div class=
"paragraph"><p>will fail with a
404 error.
</p></div>
1621 <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>,
1624 putting
"gitweb" in the subject of email.
</p></div>
1628 <h2 id=
"_see_also">SEE ALSO
</h2>
1629 <div class=
"sectionbody">
1630 <div class=
"paragraph"><p><a href=
"gitweb.conf.html">gitweb.conf(
5)
</a>,
<a href=
"git-instaweb.html">git-instaweb(
1)
</a></p></div>
1631 <div class=
"paragraph"><p><code>gitweb/README
</code>,
<code>gitweb/INSTALL
</code></p></div>
1635 <h2 id=
"_git">GIT
</h2>
1636 <div class=
"sectionbody">
1637 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
1641 <div id=
"footnotes"><hr /></div>
1643 <div id=
"footer-text">
1645 2021-
10-
29 16:
18:
45 PDT