posts:One-off_Git_daemon: Add post describing ad-hoc usage
[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 Say you have a repository that you want to serve:
9
10     $ mkdir -p ~/src/my-project
11     $ cd ~/src/my-project
12     $ git init
13     $ …hack hack hack…
14
15 Fire up the daemon (probably in another terminal so you can keep
16 hacking in your original terminal) with:
17
18     $ cd ~/src
19     $ git daemon --export-all --base-path=. --verbose ./my-project
20
21 Then you can clone with:
22
23     $ git clone git://192.168.1.2/my-project
24
25 replacing `192.168.1.2` with your public IP address (e.g. from `ip
26 addr show scope global`).
27
28 [[!tag tags/linux]]
29 [[!tag tags/tools]]