Tested on OpenBSD 6.4 with stagit-0.8

Publish Git repositories with stagit(1) on OpenBSD

stagit(1) generates HTML files from your git repository. The source of this website, for example: /src/.


Set up git and httpd, then install stagit.

# pkg_add stagit
quirks-3.16 signed on 2018-10-12T15:26:25Z
stagit-0.8:libssh2-1.8.0p0: ok
stagit-0.8:libgit2-0.27.2: ok
stagit-0.8: ok

Update Git repository

Add owner and description to the Git repository:

$ echo 'OWNER_NAME' > owner
$ echo 'DESCRIPTION' > description

Add post-receive hook to REPOSITORY.git/hooks/:

set -e
dst="/var/www/htdocs/$(basename "$(pwd)" '.git')"

mkdir -p "$dst/src"
(cd "$dst/src" && stagit "$src")
cp -f "$dst/src/log.html" "$dst/src/index.html"

Check out my files: post-receive hook and style.css.


To test post-receive hook push from your local host to the server:

$ git push REMOTE master

© 2008–2019 Roman Zolotarev  User Agreement  Privacy Policy