So as I have been increasing movingly my life into Git version control it made sense to explore methods of publishing with Git.

Turns out to be quite simple.

On the web server

Create a folder to host live site (live)

mkdir live

Create a folder to host git repository (repo)

mkdir repo

Create git bare repository in folder (repo)

cd repo
git init --bare

Within the hooks folder create a file called post-receive

nano hooks/post-receive

with the following text

#! /bin/sh
GIT_WORK_TREE="../live" git checkout -f

Now ensure the folder live is writable by the web server and that the file post-receive is executable. This hooks means that when the repository is committed to it will check out the files to the live web directory.

On the local box

Now on the box that the files exisit all you need to do is add a new remote (I tend to call it web but it can be called anything).

git remote add web *your-remote-url*

and then when you push the files will be made live.

The Dawn of Grace by Sixpence None the Richer

A nice respite from the overplayed Christmas fayre. Continue reading

MTV Unplugged by Bryan Adams

Published on November 11, 2017

Koln Concert by Keith Jarrett

Published on October 19, 2017