posts:One-off_Git_daemon: Add post describing ad-hoc usage
authorW. Trevor King <wking@tremily.us>
Mon, 18 Feb 2013 23:59:31 +0000 (18:59 -0500)
committerW. Trevor King <wking@tremily.us>
Tue, 19 Feb 2013 01:15:41 +0000 (20:15 -0500)
posts/One-off_Git_daemon.mdwn [new file with mode: 0644]

diff --git a/posts/One-off_Git_daemon.mdwn b/posts/One-off_Git_daemon.mdwn
new file mode 100644 (file)
index 0000000..5ebbf60
--- /dev/null
@@ -0,0 +1,29 @@
+In my [[gitweb]] post, I explain how to setup `git daemon` to serve
+`git://` requests under [[Nginx]] on [[Gentoo]].  This post talks
+about a different situation, where you want to toss up a Git daemon
+for collaboration on your LAN.  This is useful when you're teaching
+Git to a room full of LAN-sharing students, and you don't want to
+bother setting up public repositories more permanently.
+
+Say you have a repository that you want to serve:
+
+    $ mkdir -p ~/src/my-project
+    $ cd ~/src/my-project
+    $ git init
+    $ …hack hack hack…
+
+Fire up the daemon (probably in another terminal so you can keep
+hacking in your original terminal) with:
+
+    $ cd ~/src
+    $ git daemon --export-all --base-path=. --verbose ./my-project
+
+Then you can clone with:
+
+    $ git clone git://192.168.1.2/my-project
+
+replacing `192.168.1.2` with your public IP address (e.g. from `ip
+addr show scope global`).
+
+[[!tag tags/linux]]
+[[!tag tags/tools]]