For those of you out there that are currently using Coda as your “one-window web development” application, and would like to use the integrated source control system (Subversion aka SVN), then follow the steps below. The example is using MediaTemple’s (gs) hosting service, and my domain (bryanhun.com).
1. Enable and connect via SSH (Read here if you need help with this step)
2. Create the repository
cd /home/24334/data/repositories/
svnadmin create --fs-type fsfs bryanhun.com
3. Initial import (setting up the SVN repository correctly)
cd ~/domains
mkdir bryanhun.com-init
cd bryanhun.com-init
mkdir trunk
mkdir branches
mkdir tags
cd ..
svn import bryanhun.com-init file:///home/24334/data/repositories/bryanhun.com --message "Creating initial repo."
rm -rf bryanhun.com-init
4. Setting up the domain as a repository and getting all the original files in
cd ~/domains
mv bryanhun.com bryanhun.com-orig
mkdir bryanhun.com
cd bryanhun.com
svn checkout file:///home/24334/data/repositories/bryanhun.com/trunk/ ./
mkdir html
cd html
cp ../../bryanhun.com-orig/html/* ./
cp ../../bryanhun.com-orig/html/* ./ -rf
cp ../../bryanhun.com-orig/html/.htaccess ./
find . -name ".svn" -exec rm -rf {} \;
cd ..
svn add html
svn commit --message "Initial files from original site"
5. Setting up the post commit script
This step is only required if you want your commits to be immediately put live. This would be for development purposes only.
cd ~/../../data/repositories/bryanhun.com/hooks/
cp post-commit.tmpl post-commit
vi post-commit
# Start of post-commit
REPOS="$1"
REV="$2"
DOMAINS=/home/24334/domains/
SVN=/usr/bin/svn
SVNCONFIGDIR=/home/24334/users/.home/.subversion
DOMAIN=${REPOS:29}
UPDATEPATH=$DOMAINS$DOMAIN/
$SVN update $UPDATEPATH --config-dir $SVNCONFIGDIR
#End of post-commit
chmod +x post-commit
6. Update .htaccess to protect .svn files
RedirectMatch 404 /\\.svn(/|$)
