* linkgit:git-daemon[1] to allow anonymous download from
repository.
* linkgit:git-shell[1] can be used as a 'restricted login shell'
for shared central repository users.
* linkgit:git-http-backend[1] provides a server side implementation
of Git-over-HTTP ("Smart http") allowing both fetch and push services.
* linkgit:gitweb[1] provides a web front-end to Git repositories,
which can be set-up using the linkgit:git-instaweb[1] script.
link:howto/update-hook-example.html[update hook howto] has a good
example of managing a shared central repository.
In addition there are a number of other widely deployed hosting, browsing
and reviewing solutions such as:
* gitolite, gerrit code review, cgit and others.
Examples
~~~~~~~~
We assume the following in /etc/services::
+
------------
$ grep 9418 /etc/services
git 9418/tcp # Git Version Control System
------------
Run git-daemon to serve /pub/scm from inetd.::
+
------------
$ grep git /etc/inetd.conf
git stream tcp nowait nobody \
/usr/bin/git-daemon git-daemon --inetd --export-all /pub/scm
------------
+
The actual configuration line should be on one line.
Run git-daemon to serve /pub/scm from xinetd.::
+
------------
$ cat /etc/xinetd.d/git-daemon
# default: off
# description: The Git server offers access to Git repositories
service git
{
disable = no
type = UNLISTED
port = 9418
socket_type = stream
wait = no
user = nobody
server = /usr/bin/git-daemon
server_args = --inetd --export-all --base-path=/pub/scm
log_on_failure += USERID
}
------------
+
Check your xinetd(8) documentation and setup, this is from a Fedora system.
Others might be different.
Give push/pull only access to developers using git-over-ssh.::
e.g. those using:
`$ git push/pull ssh://host.xz/pub/scm/project`
+
------------
$ grep git /etc/passwd <1>
alice:x:1000:1000::/home/alice:/usr/bin/git-shell
bob:x:1001:1001::/home/bob:/usr/bin/git-shell
cindy:x:1002:1002::/home/cindy:/usr/bin/git-shell
david:x:1003:1003::/home/david:/usr/bin/git-shell
$ grep git /etc/shells <2>
/usr/bin/git-shell
------------
+
<1> log-in shell is set to /usr/bin/git-shell, which does not
allow anything but `git push` and `git pull`. The users require
ssh access to the machine.
<2> in many distributions /etc/shells needs to list what is used
as the login shell.
CVS-style shared repository.::
+
------------
$ grep git /etc/group <1>
git:x:9418:alice,bob,cindy,david
$ cd /home/devo.git
$ ls -l <2>
lrwxrwxrwx 1 david git 17 Dec 4 22:40 HEAD -> refs/heads/master
drwxrwsr-x 2 david git 4096 Dec 4 22:40 branches
-rw-rw-r-- 1 david git 84 Dec 4 22:40 config
-rw-rw-r-- 1 david git 58 Dec 4 22:40 description
drwxrwsr-x 2 david git 4096 Dec 4 22:40 hooks
-rw-rw-r-- 1 david git 37504 Dec 4 22:40 index
drwxrwsr-x 2 david git 4096 Dec 4 22:40 info
drwxrwsr-x 4 david git 4096 Dec 4 22:40 objects
drwxrwsr-x 4 david git 4096 Nov 7 14:58 refs
drwxrwsr-x 2 david git 4096 Dec 4 22:40 remotes
$ ls -l hooks/update <3>
-r-xr-xr-x 1 david git 3536 Dec 4 22:40 update
$ cat info/allowed-users <4>
refs/heads/master alice\|cindy
refs/heads/doc-update bob
refs/tags/v[0-9]* david
------------
+
<1> place the developers into the same git group.
<2> and make the shared repository writable by the group.
<3> use update-hook example by Carl from Documentation/howto/
for branch policy control.
<4> alice and cindy can push into master, only bob can push into doc-update.
david is the release manager and is the only person who can
create and push version tags.
GIT
---
Part of the linkgit:git[1] suite