<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Solutions Log &#187; Subversion</title>
	<atom:link href="http://solutions.treypiepmeier.com/category/scm/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://solutions.treypiepmeier.com</link>
	<description>So I don&#039;t have to figure things out more than once.</description>
	<lastBuildDate>Sun, 22 Aug 2010 19:26:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing WordPress The Right Way (revised)</title>
		<link>http://solutions.treypiepmeier.com/2008/05/28/installing-wordpress-the-right-way/</link>
		<comments>http://solutions.treypiepmeier.com/2008/05/28/installing-wordpress-the-right-way/#comments</comments>
		<pubDate>Wed, 28 May 2008 16:25:32 +0000</pubDate>
		<dc:creator>Trey</dc:creator>
				<category><![CDATA[Subversion]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://solutions.treypiepmeier.com/?p=88</guid>
		<description><![CDATA[Keep WordPress core files entirely separate from your content (themes, plugins, uploads). There are a couple of ways to keep your WordPress install up-to-date. The easiest way is to install it as an svn:external. In the root of your (Subversioned) site: svn propedit svn:externals . Then paste in: wordpress http://svn.automattic.com/wordpress/tags/[current_tag_number] Replacing [current_tag_number] with the current [...]]]></description>
			<content:encoded><![CDATA[<p>Keep WordPress core files entirely separate from your content (themes, plugins, uploads).</p>

<p>There are a couple of ways to keep your WordPress install up-to-date.  The easiest way is to install it as an <code>svn:external</code>.  In the root of your (Subversioned) site:</p>

<pre><code>svn propedit svn:externals .
</code></pre>

<p>Then paste in:</p>

<pre><code>wordpress http://svn.automattic.com/wordpress/tags/[current_tag_number]
</code></pre>

<p>Replacing <code>[current_tag_number]</code> with the current tag number (check <a href="http://wordpress.org/download/">wordpress.org/download/</a> to see the latest).  Alternately, you can just <a href="http://wordpress.org/download/">download WordPress</a> and put it in a <code>wordpress</code> folder (or <code>wp</code> or whatever you prefer) in the root of your site.</p>

<p>Now copy the default <code>wp-content</code> folder from the fresh copy of WordPress to the root of your site:</p>

<pre><code>cp -R wordpress/wp-content .
</code></pre>

<p>Delete the existing <code>.svn</code> folders from your fresh new <code>wp-content</code>.</p>

<pre><code>cd wp-content
rm -rf `find . -type d -name .svn`
</code></pre>

<p>Now create your <code>wp-config.php</code></p>

<pre><code>cd ..
cp wordpress/wp-config-sample.php wp-config.php
</code></pre>

<p>Edit the file and add your database info.  While you&#8217;re in there, add these settings to the top of the file:</p>

<pre><code>// Custom wp-content folder: 
define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content' );
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/wp-content');

define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] . '');
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress');
</code></pre>

<p>Those settings do a number of cool things.  First, you&#8217;re allowing WordPress to use your fresh copy of <code>wp-content</code> in the root of your site instead of the one that lives inside of the <code>wordpress</code> folder.  Second, you&#8217;re specifically setting some WordPress variables that are normally defined in its database in PHP, so that you won&#8217;t have to readjust your settings between development (on your local machine) and where it lives in the wild.  Third, you&#8217;re telling WordPress where to find it&#8217;s core files since you&#8217;ve put them in a subfolder (<code>/wordpress</code>).</p>

<p>Now copy <code>index.php</code> from WordPress to the root of your site:</p>

<pre><code>cp wordpress/index.php .
</code></pre>

<p>Edit the file and change the line that says:</p>

<pre><code>require('./wp-blog-header.php');
</code></pre>

<p>To this:</p>

<pre><code>require('./wordpress/wp-blog-header.php');
</code></pre>

<p>If you want fancy URLs (you do), create an <code>.htaccess</code> file:</p>

<pre><code>touch .htaccess
chmod 666 .htaccess
</code></pre>

<p>Duplicate the <code>default</code> theme:</p>

<pre><code>cp -R wp-content/themes/default wp-content/themes/[your_new_theme]
</code></pre>

<p>Replacing <code>[your_new_theme]</code> with what you want your new theme to be called.</p>

<h3>Bonus: keep Akismet as an svn:external for automatic updates from <a href="http://automattic.com/">Automattic</a>.</h3>

<pre><code>cd wp-content/plugins/
rm -rf akismet
</code></pre>

<p>Or, if you&#8217;re already committed your code:</p>

<pre><code>svn rm akismet
svn ci -m "Moving Akismet to external."
</code></pre>

<p>Then setup the external link:</p>

<pre><code>svn propedit svn:externals .
</code></pre>

<p>Paste in:</p>

<pre><code>akismet http://plugins.svn.wordpress.org/akismet/trunk/
</code></pre>

<h3>That&#8217;s it.</h3>

<p>Now commit your code and get to it.  If you get lost, check out <a href="http://wp-template.googlecode.com/">wp-template</a> for an example.</p>

<h3>Updating WordPress</h3>

<pre><code>svn propedit svn:externals .
</code></pre>

<p>Change the tag number, then <code>svn update</code> and you&#8217;re good to go.</p>

<p>If you&#8217;re not using <code>svn:externals</code>, just dump a new copy of WordPress over the one that&#8217;s already in <code>/wordpress</code>.  There&#8217;s no way you can hurt your existing content, because that&#8217;s all in the <code>/wp-content</code> folder in the root of your site.</p>

<h3>Sources</h3>

<ul>
<li><a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion">Installing/Updating WordPress with Subversion</a></li>
<li><a href="http://codex.wordpress.org/Changing_File_Permissions">Changing File Permissions</a></li>
<li><a href="http://www.anyexample.com/linux_bsd/bash/recursively_delete__svn_directories.xml">Recursively delete .svn directories</a></li>
<li><a href="http://codex.wordpress.org/Editing_wp-config.php">Editing wp-config.php</a></li>
<li><a href="http://tumblr.jasontan.org/post/72133202/wp-config">WP Config</a></li>
<li><a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">Giving WordPress its own Directory</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://solutions.treypiepmeier.com/2008/05/28/installing-wordpress-the-right-way/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Using Someone Else&#8217;s SVN Repository with Git</title>
		<link>http://solutions.treypiepmeier.com/2008/03/29/using-someone-elses-svn-repository-with-git/</link>
		<comments>http://solutions.treypiepmeier.com/2008/03/29/using-someone-elses-svn-repository-with-git/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 15:23:55 +0000</pubDate>
		<dc:creator>Trey</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2008/03/29/using-someone-elses-svn-repository-locally-with-git/</guid>
		<description><![CDATA[If you have a repository URL that looks like this: http://code.yourmom.com/project/trunk/ Issue this command (note that you leave off trunk/): git svn clone -s http://code.yourmom.com/project/ project After it&#8217;s done, see how big it is: du -hs project And you&#8217;ll see something like this: 20M project/ If it&#8217;s particularly big, go into the folder and garbage [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a repository URL that looks like this:</p>

<pre><code>http://code.yourmom.com/project/trunk/
</code></pre>

<p>Issue this command (note that you leave off <code>trunk/</code>):</p>

<pre><code>git svn clone -s http://code.yourmom.com/project/ project
</code></pre>

<p>After it&#8217;s done, see how big it is:</p>

<pre><code>du -hs project
</code></pre>

<p>And you&#8217;ll see something like this:</p>

<pre><code>20M project/
</code></pre>

<p>If it&#8217;s particularly big, go into the folder and garbage collect:</p>

<pre><code>cd project
git gc
</code></pre>

<p>From within the project folder, set your local repository to the trunk (it&#8217;s set to whatever branch had the last commit otherwise):</p>

<pre><code>git reset --hard trunk
</code></pre>

<p>Create your own branch and get to work:</p>

<pre><code>git co -b treys_changes
</code></pre>

<p>When you want to pull in the changes from the original author to stay up to date:</p>

<pre><code>git svn rebase
</code></pre>

<p>If you&#8217;ve cloned this repo (after posting it to <a href="http://github.com">GitHub</a> or elsewhere) and want to use it on another computer, you&#8217;ll have to use do more step in order to track the original SVN repo again:</p>

<pre><code>git update-ref refs/remotes/trunk origin/master
git svn init -T trunk http://code.yourmom.com/project/
</code></pre>

<h3>Sources</h3>

<ul>
<li>Brian Rosner&#8217;s <a href="http://oebfare.com/blog/2008/jan/23/using-git-django-screencast/">Using git with Django Screencast</a></li>
<li>Pieter on <a href="irc://irc.freenode.net/github">#github</a></li>
<li><a href="http://trac.webkit.org/projects/webkit/wiki/UsingGitWithWebKit#Checkout">WebKit wiki</a> (via Pieter)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://solutions.treypiepmeier.com/2008/03/29/using-someone-elses-svn-repository-with-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up a new Rails project in Subversion</title>
		<link>http://solutions.treypiepmeier.com/2007/06/25/setting-up-a-new-rails-project-in-subversion/</link>
		<comments>http://solutions.treypiepmeier.com/2007/06/25/setting-up-a-new-rails-project-in-subversion/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 03:10:17 +0000</pubDate>
		<dc:creator>Trey</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2007/06/25/setting-up-a-new-rails-project-in-subversion/</guid>
		<description><![CDATA[Create a folder to put all the junk you need to set things up. mkdir svn_setup cd svn_setup Create the standard SVN folder structure. mkdir tags mkdir branches Create a new Rails project and rename it to be the trunk folder. rails project_name mv project_name trunk The reason to do this is so your database.yml [...]]]></description>
			<content:encoded><![CDATA[<p>Create a folder to put all the junk you need to set things up.</p>

<pre><code>mkdir svn_setup
cd svn_setup
</code></pre>

<p>Create the standard SVN folder structure.</p>

<pre><code>mkdir tags
mkdir branches
</code></pre>

<p>Create a new Rails project and rename it to be the trunk folder.</p>

<pre><code>rails project_name
mv project_name trunk
</code></pre>

<p>The reason to do this is so your database.yml file (among others) will have the right project name instead of <code>trunk_development</code>, etc.</p>

<p>A little housekeeping before putting the files into the repository.</p>

<pre><code>cd trunk
rm -r tmp/*
rm -r log/*
mv config/database.yml config/database_example.yml
</code></pre>

<p>Put the files into the repository.</p>

<pre><code>cd ..
svn import . svn_project_url -m "initial import of blank Rails project" --username whathaveyou
</code></pre>

<p>Checkout the files and tell Subversion to ignore some files.</p>

<pre><code>cd ..
svn co svn_project_url/trunk project_name
cd project_name
cp config/database_example.yml config/database.yml
svn propset svn:ignore database.yml config/
svn propset svn:ignore "*" log/
svn propset svn:ignore "*" tmp/
</code></pre>

<p>If you want, setup Rails with svn:externals to that it will be ready for you to lock it into a particular version for stability.</p>

<pre><code>svn propedit svn:externals vendor/
</code></pre>

<p>In the file that pops up, enter this (or enter whatever version you want to use&#8211;such as <code>http://dev.rubyonrails.org/svn/rails/trunk/</code> for edge):</p>

<pre><code>rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-3/
</code></pre>

<p>Save then close the file.</p>

<p>Check the changes back into the repository.</p>

<pre><code>svn ci -m "Ignore database.yml, log/, and temp/.  Set up Rails with svn:extnrnals"
</code></pre>

<p>Then update your checkout to get the Rails external to load.</p>

<pre><code>svn up
</code></pre>

<h2>Other things:</h2>

<p>When you&#8217;re done with everything you can delete the <code>svn_setup</code> folder.  I think I&#8217;m going to keep mine around for a slight head start on more projects.</p>

<p>Don&#8217;t forget to use the -c option when you run <code>script/generate</code> to automatically add the files to Subversion.</p>

<pre><code>script/generate scaffold_resource angryfarmer name:string bales_of_hay:integer -c
</code></pre>

<p>When installing plugins, use the -x option to make it an svn:external</p>

<pre><code>script/plugin install -x robot_cow
</code></pre>

<h2>Source</h2>

<ul>
<li><a href="http://railscasts.com/episodes/36">Railscasts &#8211; Subversion on Rails</a></li>
<li><a href="http://snippets.dzone.com/posts/show/3251">rails svn:externals for plugins and rails edge</a></li>
<li><a href="#comment-4105">JTJ&#8217;s comment below</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://solutions.treypiepmeier.com/2007/06/25/setting-up-a-new-rails-project-in-subversion/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using Subversion to upgrade WordPress</title>
		<link>http://solutions.treypiepmeier.com/2006/10/08/using-subversion-to-upgrade-wordpress/</link>
		<comments>http://solutions.treypiepmeier.com/2006/10/08/using-subversion-to-upgrade-wordpress/#comments</comments>
		<pubDate>Sun, 08 Oct 2006 20:05:15 +0000</pubDate>
		<dc:creator>Trey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://solutions.treypiepmeier.com/2006/10/08/using-subversion-to-upgrade-wordpress/</guid>
		<description><![CDATA[Use svn:externals to install WordPress plugins How to use SVN to update WordPress Subversioning WordPress Upgrades Update (November 1, 2006): It really works. I&#8217;ve got all 3 of my blogs (one two three) now set up on SVN. The next step will to be when I add my customized themes to Subversion so all I [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://fucoder.com/2006/04/svnexternal-wordpress-plugins/">Use svn:externals to install WordPress plugins</a></li>
<li><a href="http://sethkinast.com/blog/archive/2005/05/31/svn-wordpress/">How to use SVN to update WordPress</a></li>
<li><a href="http://photomatt.net/2005/05/19/subversioning-wordpress-upgrades/">Subversioning WordPress Upgrades</a></li>
</ul>

<p><strong>Update (November 1, 2006):</strong> It really works.  I&#8217;ve got all 3 of my blogs (<a href="http://syntheticrabbit.com/blog/">one</a> <a href="http://treypiepmeier.com/">two</a> <a href="http://solutions.treypiepmeier.com/">three</a>) now set up on SVN.  The next step will to be when I add my customized themes to Subversion so all I ever have to do is go to the command line to do anything.  No (s)FTP or anything.  I imagine this will make switching servers really easy now.</p>

<p><strong>Update (January 23, 2007):</strong> To upgrade to WordPress 2.1:</p>

<ol>
<li>Disable all plugins (take a screenshot first)</li>
<li>Run this command:</li>
</ol>

<pre><code>svn switch http://svn.automattic.com/wordpress/branches/2.1/</code></pre>

<ol>
<li>Go to your admin screen and update the database when prompted.</li>
<li>Enable your plugins again.</li>
</ol>

<p><strong>Update (May 22, 2007):</strong> Just upgraded to version 2.2</p>
]]></content:encoded>
			<wfw:commentRss>http://solutions.treypiepmeier.com/2006/10/08/using-subversion-to-upgrade-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
