Note: This post requires working knowledge of SVN
svn mkdir http://svn.example.com/projects/wpblog -m "Creating blog directory"mkdir blogcd blogsvn pe svn:externals .core http://core.svn.wordpress.org/tags/2.9.2/2.9.2 with the latest version/tag from heresvn ci -m "Add externals for Wordpress"svn up wp-contentSince we want to keep our theme, plugins, and uploads under SVN, we need to make a new wp-content directory outside of core. Export the current directory from core by running:
svn export core/wp-content wp-content
svn add wp-contentsvn ci wp-content/ -m "Add wp-content"wp-config.phpNext step is to copy our wp-config.php outside of the core directory
cp core/wp-config-sample.php wp-config.phpsvn add wp-config.phpsvn ci wp-config.php -m "Add default wp-config.php" require_once(ABSPATH . 'wp-settings.php'); line:
define('WP_CONTENT_DIR', realpath(ABSPATH.'../wp-content/'));define('WP_CONTENT_URL', 'http://www.example.com/blog/wp-content');define('WP_HOME', 'http://www.example.com/blog');svn ci wp-config.php -m "Add database and wp-content settings".htaccessCreate an .htaccess file in the blog directory with the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Base is the URL path of the home directory
RewriteBase /blog/
RewriteRule ^$ core/index.php [L]
# Skip real files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise send it to WordPress
RewriteRule .* core/index.php [L]
</IfModule>
# END WordPress
To prevent Wordpress from overwriting this file, change its permissions by running chmod u-w .htaccess
Then add and commit it to SVN
svn add .htacess
svn ci .htaccess -m "Add .htaccess"
Go to http://www.example.com/blog/ and walk through the standard Wordpress install process.
Plugins can also be installed using the svn:externals method. Many of the common Wordpress plugins have a SVN repo at http://plugins.svn.wordpress.org/. As an example, lets install the All in One SEO Pack:
all-in-one-seo-pack in the list from the above linktrunk to always have the latest version of the plugin, or go under tags and click the latest version at the bottom. Copy the URL.wp-content
cd wp-content/plugins/svn:externals entry for the plugin:
svn pe svn:externals .all-in-one-seo-pack http://plugins.svn.wordpress.org/all-in-one-seo-pack/tags/1.6.9/svn ci -m "Add all-in-one-seo-pack"svn upRepeat the process for any other plugins
When a new version of Wordpress or a plugin is released, updating is very easy. If you used the trunk URL, running svn up will download all of the changes. If you used tag URL’s, svn up will download all the updates only after changing svn:externals to the latest version.
svn pe svn:externals .tags to the latest releasesvn ci -m "Update Wordpress to #.#.#"svn up