mkogg.py: Fix 'self.get_mp4_metadata(self, source)'
[blog.git] / posts / One-off_Git_daemon.mdwn
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.
7
8 Serving a few repositories
9 ==========================
10
11 Say you have a repository that you want to serve:
12
13     $ mkdir -p ~/src/my-project
14     $ cd ~/src/my-project
15     $ git init
16     $ …hack hack hack…
17
18 Fire up the daemon (probably in another terminal so you can keep
19 hacking in your original terminal) with:
20
21     $ cd ~/src
22     $ git daemon --export-all --base-path=. --verbose ./my-project
23
24 Then you can clone with:
25
26     $ git clone git://192.168.1.2/my-project
27
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.
31
32 Serving a single repository
33 ===========================
34
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
37 directory):
38
39     $ cd
40     $ git daemon --export-all --base-path=src/my-project --verbose
41
42 Then you can clone with:
43
44     $ git clone git://192.168.1.2/
45
46 This may be more convenient if you're only sharing a single
47 repository.
48
49 Enabling pushes
50 ===============
51
52 If you want your students to be able to push to your repository during
53 class, you can run:
54
55     $ git daemon --enable=receive-pack …
56
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.
59
60
61 [[!tag tags/linux]]
62 [[!tag tags/tools]]