summaryrefslogtreecommitdiffstats
path: root/man1/gitweb.1
blob: 726eb31d80d7ea2685a0bd67cf62bc69fd61c691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
'\" t
.\"     Title: gitweb
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 2024-04-29
.\"    Manual: Git Manual
.\"    Source: Git 2.45.0
.\"  Language: English
.\"
.TH "GITWEB" "1" "2024\-04\-29" "Git 2\&.45\&.0" "Git Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
gitweb \- Git web interface (web frontend to Git repositories)
.SH "SYNOPSIS"
.sp
To get started with gitweb, run \fBgit-instaweb\fR(1) from a Git repository\&. This will configure and start your web server, and run a web browser pointing to gitweb\&.
.SH "DESCRIPTION"
.sp
Gitweb provides a web interface to Git repositories\&. Its features include:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Viewing multiple Git repositories with common root\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Browsing every revision of the repository\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Viewing the contents of files in the repository at any revision\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Viewing the revision log of branches, history of files and directories, seeing what was changed, when, and by whom\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Viewing the blame/annotation details of any file (if enabled)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Generating RSS and Atom feeds of commits, for any branch\&. The feeds are auto\-discoverable in modern web browsers\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Viewing everything that was changed in a revision, and stepping through revisions one at a time, viewing the history of the repository\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Finding commits whose commit messages match a given search term\&.
.RE
.sp
See \m[blue]\fBhttps://repo\&.or\&.cz/w/git\&.git/tree/HEAD:/gitweb/\fR\m[] for gitweb source code, browsed using gitweb itself\&.
.SH "CONFIGURATION"
.sp
Various aspects of gitweb\(cqs behavior can be controlled through the configuration file \fBgitweb_config\&.perl\fR or \fB/etc/gitweb\&.conf\fR\&. See the \fBgitweb.conf\fR(5) for details\&.
.SS "Repositories"
.sp
Gitweb can show information from one or more Git repositories\&. These repositories have to be all on local filesystem, and have to share a common repository root, i\&.e\&. be all under a single parent repository (but see also the "Advanced web server setup" section, "Webserver configuration with multiple projects\*(Aq root" subsection)\&.
.sp
.if n \{\
.RS 4
.\}
.nf
our $projectroot = \*(Aq/path/to/parent/directory\*(Aq;
.fi
.if n \{\
.RE
.\}
.sp
.sp
The default value for \fB$projectroot\fR is \fB/pub/git\fR\&. You can change it during building gitweb via the \fBGITWEB_PROJECTROOT\fR build configuration variable\&.
.sp
By default all Git repositories under \fB$projectroot\fR are visible and available to gitweb\&. The list of projects is generated by default by scanning the \fB$projectroot\fR directory for Git repositories (for object databases to be more exact; gitweb is not interested in a working area, and is best suited to showing "bare" repositories)\&.
.sp
The name of the repository in gitweb is the path to its \fB$GIT_DIR\fR (its object database) relative to \fB$projectroot\fR\&. Therefore the repository $repo can be found at "$projectroot/$repo"\&.
.SS "Projects list file format"
.sp
Instead of having gitweb find repositories by scanning the filesystem starting from $projectroot, you can provide a pre\-generated list of visible projects by setting \fB$projects_list\fR to point to a plain text file with a list of projects (with some additional info)\&.
.sp
This file uses the following format:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
One record (for project / repository) per line; does not support line continuation (newline escaping)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Leading and trailing whitespace are ignored\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Whitespace separated fields; any run of whitespace can be used as field separator (rules for Perl\(cqs "\fBsplit(" ", $line)\fR")\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Fields use modified URI encoding, defined in RFC 3986, section 2\&.1 (Percent\-Encoding), or rather "Query string encoding" (see
\m[blue]\fBhttps://en\&.wikipedia\&.org/wiki/Query_string#URL_encoding\fR\m[]), the difference being that SP (" ") can be encoded as "+" (and therefore "+" has to be also percent\-encoded)\&.
.sp
Reserved characters are: "%" (used for encoding), "+" (can be used to encode SPACE), all whitespace characters as defined in Perl, including SP, TAB and LF, (used to separate fields in a record)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Currently recognized fields are:
.PP
<repository path>
.RS 4
path to repository GIT_DIR, relative to
\fB$projectroot\fR
.RE
.PP
<repository owner>
.RS 4
displayed as repository owner, preferably full name, or email, or both
.RE
.RE
.sp
You can generate the projects list index file using the project_index action (the \fITXT\fR link on projects list page) directly from gitweb; see also "Generating projects list using gitweb" section below\&.
.sp
Example contents:
.sp
.if n \{\
.RS 4
.\}
.nf
foo\&.git       Joe+R+Hacker+<joe@example\&.com>
foo/bar\&.git   O+W+Ner+<owner@example\&.org>
.fi
.if n \{\
.RE
.\}
.sp
.sp
By default this file controls only which projects are \fBvisible\fR on projects list page (note that entries that do not point to correctly recognized Git repositories won\(cqt be displayed by gitweb)\&. Even if a project is not visible on projects list page, you can view it nevertheless by hand\-crafting a gitweb URL\&. By setting \fB$strict_export\fR configuration variable (see \fBgitweb.conf\fR(5)) to true value you can allow viewing only of repositories also shown on the overview page (i\&.e\&. only projects explicitly listed in projects list file will be accessible)\&.
.SS "Generating projects list using gitweb"
.sp
We assume that GITWEB_CONFIG has its default Makefile value, namely \fIgitweb_config\&.perl\fR\&. Put the following in \fIgitweb_make_index\&.perl\fR file:
.sp
.if n \{\
.RS 4
.\}
.nf
read_config_file("gitweb_config\&.perl");
$projects_list = $projectroot;
.fi
.if n \{\
.RE
.\}
.sp
.sp
Then create the following script to get list of project in the format suitable for GITWEB_LIST build configuration variable (or \fB$projects_list\fR variable in gitweb config):
.sp
.if n \{\
.RS 4
.\}
.nf
#!/bin/sh

export GITWEB_CONFIG="gitweb_make_index\&.perl"
export GATEWAY_INTERFACE="CGI/1\&.1"
export HTTP_ACCEPT="*/*"
export REQUEST_METHOD="GET"
export QUERY_STRING="a=project_index"

perl \-\- /var/www/cgi\-bin/gitweb\&.cgi
.fi
.if n \{\
.RE
.\}
.sp
.sp
Run this script and save its output to a file\&. This file could then be used as projects list file, which means that you can set \fB$projects_list\fR to its filename\&.
.SS "Controlling access to Git repositories"
.sp
By default all Git repositories under \fB$projectroot\fR are visible and available to gitweb\&. You can however configure how gitweb controls access to repositories\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
As described in "Projects list file format" section, you can control which projects are
\fBvisible\fR
by selectively including repositories in projects list file, and setting
\fB$projects_list\fR
gitweb configuration variable to point to it\&. With
\fB$strict_export\fR
set, projects list file can be used to control which repositories are
\fBavailable\fR
as well\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
You can configure gitweb to only list and allow viewing of the explicitly exported repositories, via
\fB$export_ok\fR
variable in gitweb config file; see
\fBgitweb.conf\fR(5)
manpage\&. If it evaluates to true, gitweb shows repositories only if this file named by
\fB$export_ok\fR
exists in its object database (if directory has the magic file named
\fB$export_ok\fR)\&.
.sp
For example
\fBgit-daemon\fR(1)
by default (unless
\fB\-\-export\-all\fR
option is used) allows pulling only for those repositories that have
\fIgit\-daemon\-export\-ok\fR
file\&. Adding
.sp
.if n \{\
.RS 4
.\}
.nf
our $export_ok = "git\-daemon\-export\-ok";
.fi
.if n \{\
.RE
.\}
.sp
makes gitweb show and allow access only to those repositories that can be fetched from via
\fBgit://\fR
protocol\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Finally, it is possible to specify an arbitrary perl subroutine that will be called for each repository to determine if it can be exported\&. The subroutine receives an absolute path to the project (repository) as its only parameter (i\&.e\&. "$projectroot/$project")\&.
.sp
For example, if you use mod_perl to run the script, and have dumb HTTP protocol authentication configured for your repositories, you can use the following hook to allow access only if the user is authorized to read the files:
.sp
.if n \{\
.RS 4
.\}
.nf
$export_auth_hook = sub {
        use Apache2::SubRequest ();
        use Apache2::Const \-compile => qw(HTTP_OK);
        my $path = "$_[0]/HEAD";
        my $r    = Apache2::RequestUtil\->request;
        my $sub  = $r\->lookup_file($path);
        return $sub\->filename eq $path
            && $sub\->status == Apache2::Const::HTTP_OK;
};
.fi
.if n \{\
.RE
.\}
.sp
.RE
.SS "Per\-repository gitweb configuration"
.sp
You can configure individual repositories shown in gitweb by creating file in the \fBGIT_DIR\fR of Git repository, or by setting some repo configuration variable (in \fBGIT_DIR/config\fR, see \fBgit-config\fR(1))\&.
.sp
You can use the following files in repository:
.PP
README\&.html
.RS 4
A html file (HTML fragment) which is included on the gitweb project "summary" page inside
\fB<div>\fR
block element\&. You can use it for longer description of a project, to provide links (for example to project\(cqs homepage), etc\&. This is recognized only if XSS prevention is off (\fB$prevent_xss\fR
is false, see
\fBgitweb.conf\fR(5)); a way to include a README safely when XSS prevention is on may be worked out in the future\&.
.RE
.PP
description (or \fBgitweb\&.description\fR)
.RS 4
Short (shortened to
\fB$projects_list_description_width\fR
in the projects list page, which is 25 characters by default; see
\fBgitweb.conf\fR(5)) single line description of a project (of a repository)\&. Plain text file; HTML will be escaped\&. By default set to
.sp
.if n \{\
.RS 4
.\}
.nf
Unnamed repository; edit this file to name it for gitweb\&.
.fi
.if n \{\
.RE
.\}
.sp
from the template during repository creation, usually installed in
\fB/usr/share/git\-core/templates/\fR\&. You can use the
\fBgitweb\&.description\fR
repo configuration variable, but the file takes precedence\&.
.RE
.PP
category (or \fBgitweb\&.category\fR)
.RS 4
Singe line category of a project, used to group projects if
\fB$projects_list_group_categories\fR
is enabled\&. By default (file and configuration variable absent), uncategorized projects are put in the
\fB$project_list_default_category\fR
category\&. You can use the
\fBgitweb\&.category\fR
repo configuration variable, but the file takes precedence\&.
.sp
The configuration variables
\fB$projects_list_group_categories\fR
and
\fB$project_list_default_category\fR
are described in
\fBgitweb.conf\fR(5)
.RE
.PP
cloneurl (or multiple\-valued \fBgitweb\&.url\fR)
.RS 4
File with repository URL (used for clone and fetch), one per line\&. Displayed in the project summary page\&. You can use multiple\-valued
\fBgitweb\&.url\fR
repository configuration variable for that, but the file takes precedence\&.
.sp
This is per\-repository enhancement / version of global prefix\-based
\fB@git_base_url_list\fR
gitweb configuration variable (see
\fBgitweb.conf\fR(5))\&.
.RE
.PP
gitweb\&.owner
.RS 4
You can use the
\fBgitweb\&.owner\fR
repository configuration variable to set repository\(cqs owner\&. It is displayed in the project list and summary page\&.
.sp
If it\(cqs not set, filesystem directory\(cqs owner is used (via GECOS field, i\&.e\&. real name field from
\fBgetpwuid\fR(3)) if
\fB$projects_list\fR
is unset (gitweb scans
\fB$projectroot\fR
for repositories); if
\fB$projects_list\fR
points to file with list of repositories, then project owner defaults to value from this file for given repository\&.
.RE
.PP
various \fBgitweb\&.*\fR config variables (in config)
.RS 4
Read description of
\fB%feature\fR
hash for detailed list, and descriptions\&. See also "Configuring gitweb features" section in
\fBgitweb.conf\fR(5)
.RE
.SH "ACTIONS, AND URLS"
.sp
Gitweb can use path_info (component) based URLs, or it can pass all necessary information via query parameters\&. The typical gitweb URLs are broken down in to five components:
.sp
.if n \{\
.RS 4
.\}
.nf
\&.\&.\&./gitweb\&.cgi/<repo>/<action>/<revision>:/<path>?<arguments>
.fi
.if n \{\
.RE
.\}
.sp

.PP
repo
.RS 4
The repository the action will be performed on\&.
.sp
All actions except for those that list all available projects, in whatever form, require this parameter\&.
.RE
.PP
action
.RS 4
The action that will be run\&. Defaults to
\fIprojects_list\fR
if repo is not set, and to
\fIsummary\fR
otherwise\&.
.RE
.PP
revision
.RS 4
Revision shown\&. Defaults to HEAD\&.
.RE
.PP
path
.RS 4
The path within the <repository> that the action is performed on, for those actions that require it\&.
.RE
.PP
arguments
.RS 4
Any arguments that control the behaviour of the action\&.
.RE
.sp
Some actions require or allow to specify two revisions, and sometimes even two pathnames\&. In most general form such path_info (component) based gitweb URL looks like this:
.sp
.if n \{\
.RS 4
.\}
.nf
\&.\&.\&./gitweb\&.cgi/<repo>/<action>/<revision\-from>:/<path\-from>\&.\&.<revision\-to>:/<path\-to>?<arguments>
.fi
.if n \{\
.RE
.\}
.sp
.sp
Each action is implemented as a subroutine, and must be present in %actions hash\&. Some actions are disabled by default, and must be turned on via feature mechanism\&. For example to enable \fIblame\fR view add the following to gitweb configuration file:
.sp
.if n \{\
.RS 4
.\}
.nf
$feature{\*(Aqblame\*(Aq}{\*(Aqdefault\*(Aq} = [1];
.fi
.if n \{\
.RE
.\}
.sp
.SS "Actions:"
.sp
The standard actions are:
.PP
project_list
.RS 4
Lists the available Git repositories\&. This is the default command if no repository is specified in the URL\&.
.RE
.PP
summary
.RS 4
Displays summary about given repository\&. This is the default command if no action is specified in URL, and only repository is specified\&.
.RE
.PP
heads, remotes
.RS 4
Lists all local or all remote\-tracking branches in given repository\&.
.sp
The latter is not available by default, unless configured\&.
.RE
.PP
tags
.RS 4
List all tags (lightweight and annotated) in given repository\&.
.RE
.PP
blob, tree
.RS 4
Shows the files and directories in a given repository path, at given revision\&. This is default command if no action is specified in the URL, and path is given\&.
.RE
.PP
blob_plain
.RS 4
Returns the raw data for the file in given repository, at given path and revision\&. Links to this action are marked
\fIraw\fR\&.
.RE
.PP
blobdiff
.RS 4
Shows the difference between two revisions of the same file\&.
.RE
.PP
blame, blame_incremental
.RS 4
Shows the blame (also called annotation) information for a file\&. On a per line basis it shows the revision in which that line was last changed and the user that committed the change\&. The incremental version (which if configured is used automatically when JavaScript is enabled) uses Ajax to incrementally add blame info to the contents of given file\&.
.sp
This action is disabled by default for performance reasons\&.
.RE
.PP
commit, commitdiff
.RS 4
Shows information about a specific commit in a repository\&. The
\fIcommit\fR
view shows information about commit in more detail, the
\fIcommitdiff\fR
action shows changeset for given commit\&.
.RE
.PP
patch
.RS 4
Returns the commit in plain text mail format, suitable for applying with
\fBgit-am\fR(1)\&.
.RE
.PP
tag
.RS 4
Display specific annotated tag (tag object)\&.
.RE
.PP
log, shortlog
.RS 4
Shows log information (commit message or just commit subject) for a given branch (starting from given revision)\&.
.sp
The
\fIshortlog\fR
view is more compact; it shows one commit per line\&.
.RE
.PP
history
.RS 4
Shows history of the file or directory in a given repository path, starting from given revision (defaults to HEAD, i\&.e\&. default branch)\&.
.sp
This view is similar to
\fIshortlog\fR
view\&.
.RE
.PP
rss, atom
.RS 4
Generates an RSS (or Atom) feed of changes to repository\&.
.RE
.SH "WEBSERVER CONFIGURATION"
.sp
This section explains how to configure some common webservers to run gitweb\&. In all cases, \fB/path/to/gitweb\fR in the examples is the directory you ran installed gitweb in, and contains \fBgitweb_config\&.perl\fR\&.
.sp
If you\(cqve configured a web server that isn\(cqt listed here for gitweb, please send in the instructions so they can be included in a future release\&.
.SS "Apache as CGI"
.sp
Apache must be configured to support CGI scripts in the directory in which gitweb is installed\&. Let\(cqs assume that it is \fB/var/www/cgi\-bin\fR directory\&.
.sp
.if n \{\
.RS 4
.\}
.nf
ScriptAlias /cgi\-bin/ "/var/www/cgi\-bin/"

<Directory "/var/www/cgi\-bin">
    Options Indexes FollowSymlinks ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
.fi
.if n \{\
.RE
.\}
.sp
.sp
With that configuration the full path to browse repositories would be:
.sp
.if n \{\
.RS 4
.\}
.nf
http://server/cgi\-bin/gitweb\&.cgi
.fi
.if n \{\
.RE
.\}
.SS "Apache with mod_perl, via ModPerl::Registry"
.sp
You can use mod_perl with gitweb\&. You must install Apache::Registry (for mod_perl 1\&.x) or ModPerl::Registry (for mod_perl 2\&.x) to enable this support\&.
.sp
Assuming that gitweb is installed to \fB/var/www/perl\fR, the following Apache configuration (for mod_perl 2\&.x) is suitable\&.
.sp
.if n \{\
.RS 4
.\}
.nf
Alias /perl "/var/www/perl"

<Directory "/var/www/perl">
    SetHandler perl\-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    Options Indexes FollowSymlinks +ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
.fi
.if n \{\
.RE
.\}
.sp
.sp
With that configuration the full path to browse repositories would be:
.sp
.if n \{\
.RS 4
.\}
.nf
http://server/perl/gitweb\&.cgi
.fi
.if n \{\
.RE
.\}
.SS "Apache with FastCGI"
.sp
Gitweb works with Apache and FastCGI\&. First you need to rename, copy or symlink gitweb\&.cgi to gitweb\&.fcgi\&. Let\(cqs assume that gitweb is installed in \fB/usr/share/gitweb\fR directory\&. The following Apache configuration is suitable (UNTESTED!)
.sp
.if n \{\
.RS 4
.\}
.nf
FastCgiServer /usr/share/gitweb/gitweb\&.cgi
ScriptAlias /gitweb /usr/share/gitweb/gitweb\&.cgi

Alias /gitweb/static /usr/share/gitweb/static
<Directory /usr/share/gitweb/static>
    SetHandler default\-handler
</Directory>
.fi
.if n \{\
.RE
.\}
.sp
.sp
With that configuration the full path to browse repositories would be:
.sp
.if n \{\
.RS 4
.\}
.nf
http://server/gitweb
.fi
.if n \{\
.RE
.\}
.SH "ADVANCED WEB SERVER SETUP"
.sp
All of those examples use request rewriting, and need \fBmod_rewrite\fR (or equivalent; examples below are written for Apache)\&.
.SS "Single URL for gitweb and for fetching"
.sp
If you want to have one URL for both gitweb and your \fBhttp://\fR repositories, you can configure Apache like this:
.sp
.if n \{\
.RS 4
.\}
.nf
<VirtualHost *:80>
    ServerName    git\&.example\&.org
    DocumentRoot  /pub/git
    SetEnv        GITWEB_CONFIG   /etc/gitweb\&.conf

    # turning on mod rewrite
    RewriteEngine on

    # make the front page an internal rewrite to the gitweb script
    RewriteRule ^/$  /cgi\-bin/gitweb\&.cgi

    # make access for "dumb clients" work
    RewriteRule ^/(\&.*\e\&.git/(?!/?(HEAD|info|objects|refs))\&.*)?$ \e
                /cgi\-bin/gitweb\&.cgi%{REQUEST_URI}  [L,PT]
</VirtualHost>
.fi
.if n \{\
.RE
.\}
.sp
.sp
The above configuration expects your public repositories to live under \fB/pub/git\fR and will serve them as \fBhttp://git\&.domain\&.org/dir\-under\-pub\-git\fR, both as clonable Git URL and as browsable gitweb interface\&. If you then start your \fBgit-daemon\fR(1) with \fB\-\-base\-path=/pub/git \-\-export\-all\fR then you can even use the \fBgit://\fR URL with exactly the same path\&.
.sp
Setting the environment variable \fBGITWEB_CONFIG\fR will tell gitweb to use the named file (i\&.e\&. in this example \fB/etc/gitweb\&.conf\fR) as a configuration for gitweb\&. You don\(cqt really need it in above example; it is required only if your configuration file is in different place than built\-in (during compiling gitweb) \fIgitweb_config\&.perl\fR or \fB/etc/gitweb\&.conf\fR\&. See \fBgitweb.conf\fR(5) for details, especially information about precedence rules\&.
.sp
If you use the rewrite rules from the example you \fBmight\fR also need something like the following in your gitweb configuration file (\fB/etc/gitweb\&.conf\fR following example):
.sp
.if n \{\
.RS 4
.\}
.nf
@stylesheets = ("/some/absolute/path/gitweb\&.css");
$my_uri    = "/";
$home_link = "/";
$per_request_config = 1;
.fi
.if n \{\
.RE
.\}
.sp
.sp
Nowadays though gitweb should create HTML base tag when needed (to set base URI for relative links), so it should work automatically\&.
.SS "Webserver configuration with multiple projects\*(Aq root"
.sp
If you want to use gitweb with several project roots you can edit your Apache virtual host and gitweb configuration files in the following way\&.
.sp
The virtual host configuration (in Apache configuration file) should look like this:
.sp
.if n \{\
.RS 4
.\}
.nf
<VirtualHost *:80>
    ServerName    git\&.example\&.org
    DocumentRoot  /pub/git
    SetEnv        GITWEB_CONFIG  /etc/gitweb\&.conf

    # turning on mod rewrite
    RewriteEngine on

    # make the front page an internal rewrite to the gitweb script
    RewriteRule ^/$  /cgi\-bin/gitweb\&.cgi  [QSA,L,PT]

    # look for a public_git directory in unix users\*(Aq home
    # http://git\&.example\&.org/~<user>/
    RewriteRule ^/\e~([^\e/]+)(/|/gitweb\&.cgi)?$   /cgi\-bin/gitweb\&.cgi \e
                [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]

    # http://git\&.example\&.org/+<user>/
    #RewriteRule ^/\e+([^\e/]+)(/|/gitweb\&.cgi)?$  /cgi\-bin/gitweb\&.cgi \e
                 [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]

    # http://git\&.example\&.org/user/<user>/
    #RewriteRule ^/user/([^\e/]+)/(gitweb\&.cgi)?$ /cgi\-bin/gitweb\&.cgi \e
                 [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]

    # defined list of project roots
    RewriteRule ^/scm(/|/gitweb\&.cgi)?$ /cgi\-bin/gitweb\&.cgi \e
                [QSA,E=GITWEB_PROJECTROOT:/pub/scm/,L,PT]
    RewriteRule ^/var(/|/gitweb\&.cgi)?$ /cgi\-bin/gitweb\&.cgi \e
                [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]

    # make access for "dumb clients" work
    RewriteRule ^/(\&.*\e\&.git/(?!/?(HEAD|info|objects|refs))\&.*)?$ \e
                /cgi\-bin/gitweb\&.cgi%{REQUEST_URI}  [L,PT]
</VirtualHost>
.fi
.if n \{\
.RE
.\}
.sp
.sp
Here actual project root is passed to gitweb via \fBGITWEB_PROJECT_ROOT\fR environment variable from a web server, so you need to put the following line in gitweb configuration file (\fB/etc/gitweb\&.conf\fR in above example):
.sp
.if n \{\
.RS 4
.\}
.nf
$projectroot = $ENV{\*(AqGITWEB_PROJECTROOT\*(Aq} || "/pub/git";
.fi
.if n \{\
.RE
.\}
.sp
.sp
\fBNote\fR that this requires to be set for each request, so either \fB$per_request_config\fR must be false, or the above must be put in code referenced by \fB$per_request_config\fR;
.sp
These configurations enable two things\&. First, each unix user (\fB<user>\fR) of the server will be able to browse through gitweb Git repositories found in \fB~/public_git/\fR with the following url:
.sp
.if n \{\
.RS 4
.\}
.nf
http://git\&.example\&.org/~<user>/
.fi
.if n \{\
.RE
.\}
.sp
If you do not want this feature on your server just remove the second rewrite rule\&.
.sp
If you already use \(oqmod_userdir` in your virtual host or you don\(cqt want to use the \*(Aq~\(cq as first character, just comment or remove the second rewrite rule, and uncomment one of the following according to what you want\&.
.sp
Second, repositories found in \fB/pub/scm/\fR and \fB/var/git/\fR will be accessible through \fBhttp://git\&.example\&.org/scm/\fR and \fBhttp://git\&.example\&.org/var/\fR\&. You can add as many project roots as you want by adding rewrite rules like the third and the fourth\&.
.SS "PATH_INFO usage"
.sp
If you enable PATH_INFO usage in gitweb by putting
.sp
.if n \{\
.RS 4
.\}
.nf
$feature{\*(Aqpathinfo\*(Aq}{\*(Aqdefault\*(Aq} = [1];
.fi
.if n \{\
.RE
.\}
.sp
.sp
in your gitweb configuration file, it is possible to set up your server so that it consumes and produces URLs in the form
.sp
.if n \{\
.RS 4
.\}
.nf
http://git\&.example\&.com/project\&.git/shortlog/sometag
.fi
.if n \{\
.RE
.\}
.sp
i\&.e\&. without \fIgitweb\&.cgi\fR part, by using a configuration such as the following\&. This configuration assumes that \fB/var/www/gitweb\fR is the DocumentRoot of your webserver, contains the gitweb\&.cgi script and complementary static files (stylesheet, favicon, JavaScript):
.sp
.if n \{\
.RS 4
.\}
.nf
<VirtualHost *:80>
        ServerAlias git\&.example\&.com

        DocumentRoot /var/www/gitweb

        <Directory /var/www/gitweb>
                Options ExecCGI
                AddHandler cgi\-script cgi

                DirectoryIndex gitweb\&.cgi

                RewriteEngine On
                RewriteCond %{REQUEST_FILENAME} !\-f
                RewriteCond %{REQUEST_FILENAME} !\-d
                RewriteRule ^\&.* /gitweb\&.cgi/$0 [L,PT]
        </Directory>
</VirtualHost>
.fi
.if n \{\
.RE
.\}
.sp
.sp
The rewrite rule guarantees that existing static files will be properly served, whereas any other URL will be passed to gitweb as PATH_INFO parameter\&.
.sp
\fBNotice\fR that in this case you don\(cqt need special settings for \fB@stylesheets\fR, \fB$my_uri\fR and \fB$home_link\fR, but you lose "dumb client" access to your project \&.git dirs (described in "Single URL for gitweb and for fetching" section)\&. A possible workaround for the latter is the following: in your project root dir (e\&.g\&. \fB/pub/git\fR) have the projects named \fBwithout\fR a \&.git extension (e\&.g\&. \fB/pub/git/project\fR instead of \fB/pub/git/project\&.git\fR) and configure Apache as follows:
.sp
.if n \{\
.RS 4
.\}
.nf
<VirtualHost *:80>
        ServerAlias git\&.example\&.com

        DocumentRoot /var/www/gitweb

        AliasMatch ^(/\&.*?)(\e\&.git)(/\&.*)?$ /pub/git$1$3
        <Directory /var/www/gitweb>
                Options ExecCGI
                AddHandler cgi\-script cgi

                DirectoryIndex gitweb\&.cgi

                RewriteEngine On
                RewriteCond %{REQUEST_FILENAME} !\-f
                RewriteCond %{REQUEST_FILENAME} !\-d
                RewriteRule ^\&.* /gitweb\&.cgi/$0 [L,PT]
        </Directory>
</VirtualHost>
.fi
.if n \{\
.RE
.\}
.sp
.sp
The additional AliasMatch makes it so that
.sp
.if n \{\
.RS 4
.\}
.nf
http://git\&.example\&.com/project\&.git
.fi
.if n \{\
.RE
.\}
.sp
will give raw access to the project\(cqs Git dir (so that the project can be cloned), while
.sp
.if n \{\
.RS 4
.\}
.nf
http://git\&.example\&.com/project
.fi
.if n \{\
.RE
.\}
.sp
will provide human\-friendly gitweb access\&.
.sp
This solution is not 100% bulletproof, in the sense that if some project has a named ref (branch, tag) starting with \fBgit/\fR, then paths such as
.sp
.if n \{\
.RS 4
.\}
.nf
http://git\&.example\&.com/project/command/abranch\&.\&.git/abranch
.fi
.if n \{\
.RE
.\}
.sp
will fail with a 404 error\&.
.SH "BUGS"
.sp
Please report any bugs or feature requests to \m[blue]\fBgit@vger\&.kernel\&.org\fR\m[]\&\s-2\u[1]\d\s+2, putting "gitweb" in the subject of email\&.
.SH "SEE ALSO"
.sp
\fBgitweb.conf\fR(5), \fBgit-instaweb\fR(1)
.sp
\fBgitweb/README\fR, \fBgitweb/INSTALL\fR
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite
.SH "NOTES"
.IP " 1." 4
git@vger.kernel.org
.RS 4
\%mailto:git@vger.kernel.org
.RE