From: W. Trevor King Date: Fri, 29 Mar 2013 17:13:22 +0000 (-0400) Subject: posts:one-off-git-daemon: Add an --enable=receive-pack section X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c0fa169393e9a1abc9bed6cedb8fd69fcadcde70;p=blog.git posts:one-off-git-daemon: Add an --enable=receive-pack section Also add headings for serving a single repository and serving a few repositories, since with --enable=receive-pack the post was getting a bit long for one section. --- diff --git a/posts/One-off_Git_daemon.mdwn b/posts/One-off_Git_daemon.mdwn index e587e2f..3bbaa34 100644 --- a/posts/One-off_Git_daemon.mdwn +++ b/posts/One-off_Git_daemon.mdwn @@ -5,6 +5,9 @@ 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. +Serving a few repositories +========================== + Say you have a repository that you want to serve: $ mkdir -p ~/src/my-project @@ -23,7 +26,11 @@ 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`). +addr show scope global`). Add additional repository paths to the `git +daemon` call to serve additional repositories. + +Serving a single repository +=========================== If you don't want to bother listing `my-project` in your URLs, you can base the daemon in the project itself (instead of in the parent @@ -39,6 +46,17 @@ Then you can clone with: This may be more convenient if you're only sharing a single repository. +Enabling pushes +=============== + +If you want your students to be able to push to your repository during +class, you can run: + + $ git daemon --enable=receive-pack … + +Only do this on a trusted LAN with a junk test repository, because it +will allow *anybody* to push *anything* or remove references. + [[!tag tags/linux]] [[!tag tags/tools]]