# Remote Gopherlog with Git // 18-11-17 (See also my recent clog entry about this topic.) To update the working repo on C.S whenever I add a clog post, I have installed a git hook together with some special directory settings. ## file structure - `$HOME/gopher/clog/` is part of a git repo with remote origin at ... - local bare git repo in `$HOME/X/repo.git` - git hook script in `$HOME/.git-post-update-hook` -- this is to allow the hook script (see below) itself being part of the git repo - symbolic link from `$HOME/X/repo.git/hooks/post-update` to hook script A local bare git repo (X/repo.git) is required, because it's not possible (or at least risky) to push directly into the working directory at `$HOME/gopher/clog/.` ## hook script #!/bin/sh # directory hardcoded (not using $HOME) for security reasons cdir=/home/yargo/gopher/clog echo :post-update: # to prevent "git checkout" from failing due to wrond default dir unset GIT_DIR # pull possible updates, checkout, and force everything readable cd "$cdir" && git pull && git checkout . && chmod a+r * ## workflow - on remote machine (laptop, server, tablet etc), work in repo cloned with `git clone circumlunar:X/repo.git` - when finished, commit changes and push into X/repo.git - check remote echoing after ":post-update:" tag: should show checkout message from end of hook script - check whether publication worked, by accessing gopherspace ## git-gopher account server This hack recently has evolved in an independent project on a side show of circumlunar.space, namely dome.circumlunar.space. That server, called "Ryumin's Dome", is a testbed for the idea of offering gopher hosting provided fully through git only. People can get an account with a pre-installed git repo that is always mirrored publicly through a gopher server (gophernicus in that case), giving complete control over the contents and inherent local backup and the possibility of instantly shifting it over to another server. The git repo with the scripts for account generation are all published at git://circumlunar.space/gigof for cloning.