1 In my [[gitweb]] post, I explain how to setup `git daemon` to serve
2 `git://` requests under [[Nginx]] on [[Gentoo]]. This post talks
3 about a different situation, where you want to toss up a Git daemon
4 for collaboration on your LAN. This is useful when you're teaching
5 Git to a room full of LAN-sharing students, and you don't want to
6 bother setting up public repositories more permanently.
8 Serving a few repositories
9 ==========================
11 Say you have a repository that you want to serve:
13 $ mkdir -p ~/src/my-project
18 Fire up the daemon (probably in another terminal so you can keep
19 hacking in your original terminal) with:
22 $ git daemon --export-all --base-path=. --verbose ./my-project
24 Then you can clone with:
26 $ git clone git://192.168.1.2/my-project
28 replacing `192.168.1.2` with your public IP address (e.g. from `ip
29 addr show scope global`). Add additional repository paths to the `git
30 daemon` call to serve additional repositories.
32 Serving a single repository
33 ===========================
35 If you don't want to bother listing `my-project` in your URLs, you can
36 base the daemon in the project itself (instead of in the parent
40 $ git daemon --export-all --base-path=src/my-project --verbose
42 Then you can clone with:
44 $ git clone git://192.168.1.2/
46 This may be more convenient if you're only sharing a single
52 If you want your students to be able to push to your repository during
55 $ git daemon --enable=receive-pack …
57 Only do this on a trusted LAN with a junk test repository, because it
58 will allow *anybody* to push *anything* or remove references.