nixre.net
== Manage website with git ==

My shortened version of http://toroid.org/git-website-howto


-------------------------------------------------------------------------------
1) start with a new repository on you local machine
-------------------------------------------------------------------------------

	$ mkdir website
	$ cd website
	$ git init
	$ echo 'hi there' > index.html

Depending on situation the following 2 git configs may be necessary

	$ git config user.name "NAME"
	$ git config user.email "NAME@HOST"


	$ git add index.html
	$ git commit -q -m "Initial commit"

-------------------------------------------------------------------------------
2) The remote repository
-------------------------------------------------------------------------------

Target directory ( document root ) must exist before.

	$ mkdir website.git
	$ cd website.git
	$ git init --bare

Create a file in website.git/hooks called 'post-receive' with the following
content:

	#!/bin/sh
	GIT_WORK_TREE=/var/www/website git checkout -f

and make it exectuable

	$ chmod +x website.git/hooks/post-receive

-------------------------------------------------------------------------------
3) Back on your local machine
-------------------------------------------------------------------------------

	$ git remote add origin \
	ssh://<hostname>.<domainname>.<tld>/home/<username>/website.git
	$ git push origin +master:refs:heads/master