Andy Taylor

Andy Taylor

How to update your website on Nearly Free Speech via Git

Nov 3, 2012 —

Nice guide on publishing to Nearly Free Speech hosting via Git. Would be much easier to push changes with Git than using standard SFTP. Might have to try this for Style Manual.

Update: I gave this a shot and it works great. There were a few minor errors in the post (cleared up in the comments), so I’m posting the commands that worked for me:

SSH into your Nearly Free Speech account (Your Username and SSH/SFTP Hostname are listed on your Site Information page on NFS):


Once you’re in, run the following commands:

mkdir .git
cd .git
git init --bare
cd hooks
touch post-receive
pico post-receive

Add the following and save.

GIT_WORK_TREE=/home/public git checkout -f

Run this to adjust the access rights of the file:

chmod +x post-receive

Back in your local Git repo run (using your username again):

git remote add website ssh://

Running the following should push your local repo to your newly created remote on NFS:

git push website master

Have a comment? @me on Twitter.