<?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>danielmiessler.com &#187; Development</title>
	<atom:link href="http://danielmiessler.com/categories/development/feed" rel="self" type="application/rss+xml" />
	<link>http://danielmiessler.com</link>
	<description>grep understanding</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:25:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How To Set Up Subversion</title>
		<link>http://danielmiessler.com/blog/how-to-set-up-subversion</link>
		<comments>http://danielmiessler.com/blog/how-to-set-up-subversion#comments</comments>
		<pubDate>Thu, 06 Sep 2007 00:35:11 +0000</pubDate>
		<dc:creator>Daniel Miessler</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://dmiessler.com/blogarchive/how-to-set-up-subversion</guid>
		<description><![CDATA[&#60; p style=&#8221;text-align: center&#8221;> ext3cow.com Setting up Subversion for revision control can be a bit frustrating. There are a million sites talking about how to do it, but many of them are contradictory and/or overly complex. Here&#8217;s a simple approach that works for me every time. Create Your Repository svnadmin create /Repository This utilizes the [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;</p>

<p>p style=&#8221;text-align: center&#8221;><img src="http://www.ext3cow.com/Blog/A5D08A69-4F96-49F0-9AD0-22208CF877C6_files/subversion_logo_hor-468x64.png" title="subversion" alt="subversion" height="110" width="306" />
<small>ext3cow.com</small></p>

<p>Setting up <a href="http://subversion.tigris.org/">Subversion</a> for <a href="http://en.wikipedia.org/wiki/Revision_control">revision control</a> can be a bit frustrating. There are a million sites talking about how to do it, but many of them are contradictory and/or overly complex. Here&#8217;s a simple approach that works for me every time.</p>

<p><strong>Create Your Repository</strong></p>

<p><span class="hcommand">svnadmin create /Repository</span></p>

<p>This utilizes the <code>svnadmin</code> that creates the main directory that your projects will reside in.</p>

<p><strong>Create Your Project</strong></p>

<p><span class="hcommand">svn mkdir file:///Repository/dmiessler.com</span></p>

<p>Notice that you can&#8217;t just create this with regular <code>mkdir</code>. You need the <code>svn</code> bit. This won&#8217;t create an actual directory under /Repository, by the way. Don&#8217;t worry, it&#8217;s there. You can view it with <code>svn list file:///Repository</code>.</p>

<p><strong>Populate Your Repository (Import)</strong>
Go into your web directory and run:</p>

<p><span class="hcommand">svn import . file:///Repository/dmiessler.com -m &#8220;Initial Import&#8221;</span></p>

<p>This pulls a copy of your website into your working development directory.</p>

<p><strong>Check Out a Copy to a Temporary Directory</strong>
Change directory into /tmp and run:</p>

<p><span class="hcommand">svn co file:///Repository/dmiessler.com</span></p>

<p>This pulls a copy of your website from your development repository to your temporary location.</p>

<p><strong>Move That Temporary Working Copy Next To Your Web Directory </strong>
Move your temp copy next to your web directory, then go one directory higher than your web directory and run:</p>

<p><span class="hcommand">mv htdocs htdocs_backup</span></p>

<p><strong>Make The Switch</strong></p>

<p><span class="hcommand">mv dmiessler.com htdocs</span></p>

<p>This puts your subversion copy of your site where your non-version-controlled version used to be.</p>

<p><strong>Check Out a Copy To Work With On Your Development System</strong>
Install subversion on your client and cd into your dev directory (I use OS X).</p>

<p><span class="hcommand">svn co svn+ssh://user@dmiessler.com/Repository/dmiessler.com </span></p>

<p>This pulls a copy of your repository down to your development machine. Notice that you&#8217;ll now have a copy of the site in that directory. This is the version of the site that you&#8217;ll be making changes to.</p>

<p><strong>Use TextMate To Edit Your Local Version</strong>
Just a recommendation of course, but a <strong>strong</strong> recommendation. Download and install <a href="http://www.macromates.com/">TextMate</a> to edit your copy of the site. File &#8211;&gt; New Project. Drag and drop your site&#8217;s directory into the folder pane.Once you&#8217;ve made some changes, you can use TextMate&#8217;s built-in subversion support. Make a change to your code and then press shift-control-A, which allows you to select &#8220;commit&#8221; to update the repository.</p>

<p><strong>[Optional] Configure an Automatic <code>svn up</code></strong>
If you don&#8217;t do this trick you&#8217;ll have to go into the root of your web directory on the server and run <code>svn up</code> to get the changes from the repository into production.</p>

<p>This allows you to bypass that by making use of subversion&#8217;s post-commit hook. Essentially, anything in that post-commit hook script gets run right as you check in from the client (commit). So what we do is make use of a little C++ program that will run the <code>svn up</code> for us. Here&#8217;s the code:
<pre class="codeblock"></p>

<h1>include <stddef.h></h1>

<h1>include <stdlib.h></h1>

<h1>include <unistd.h></h1>

<p>int main(void)
{
  execl("/usr/local/bin/svn", "svn", "update", "/home/joe/public_html/",
        (const char *) NULL);
  return(EXIT_FAILURE);
}
</unistd.h></stdlib.h></stddef.h></pre>
Then:</p>

<p><span class="hcommand">gcc -o svn_update svn_update.cpp</span></p>

<h2>Then just point to it from your post-commit script (be sure to remove the template suffix).</h2>

<p>So now when you make a change you just commit it and it&#8217;s live on the site.  All with the protection of being able to roll back your various changes if  you need to.:</p>
<div id="crp_related"><h3>Related Content</h3><ul><li><a href="http://danielmiessler.com/blog/learning-git" rel="bookmark" class="crp_title">Learning git</a></li><li><a href="http://danielmiessler.com/blog/git-ignore-wordpress-cache-files-using-gitignore" rel="bookmark" class="crp_title">Git: Ignore WordPress Cache Files using .gitignore</a></li><li><a href="http://danielmiessler.com/blog/how-to-add-directory-colors-to-os-xs-terminal" rel="bookmark" class="crp_title">How to Add Directory Colors to OS X&#8217;s Terminal</a></li><li><a href="http://danielmiessler.com/blog/removing-files-from-a-git-repository-without-actually-deleting-them" rel="bookmark" class="crp_title">Removing Files from a Git Repository Without Actually Deleting Them</a></li><li><a href="http://danielmiessler.com/blog/installing-the-latest-version-of-nmap-using-subversion" rel="bookmark" class="crp_title">Installing the Latest Version of Nmap Using Subversion</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://danielmiessler.com/blog/how-to-set-up-subversion/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>August 2007 Site Enhancements</title>
		<link>http://danielmiessler.com/blog/august-2007-site-enhancements</link>
		<comments>http://danielmiessler.com/blog/august-2007-site-enhancements#comments</comments>
		<pubDate>Wed, 15 Aug 2007 00:29:22 +0000</pubDate>
		<dc:creator>Daniel Miessler</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://dmiessler.com/blogarchive/august-2007-site-enhancements</guid>
		<description><![CDATA[I&#8217;ve added a syndication page to my navigation menu. There you can find all my various feeds (6). They are all now available via my RSS icon in the URL bar as well. blog study writing links itunes mobile photos Links points to my Google Shared items from Google Reader. So anything I mark as [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://dmiessler.com/images/rss_icon_large.jpeg" title="rss_icon" alt="rss_icon" /></p>

<p>I&#8217;ve added a <a href="http://dmiessler.com/syndication/">syndication</a> page to my navigation menu. There you can find all my various feeds (<strong>6</strong>). They are all now available via my RSS icon in the URL bar as well.</p>

<ul>
    <li><a href="http://feeds.feedburner.com/dmiessler">blog</a></li>
    <li><a href="http://feeds.feedburner.com/dmiessler_study">study</a></li>
    <li><a href="http://feeds.feedburner.com/dmiessler_writing">writing</a></li>
    <li><a href="http://feeds.feedburner.com/dmiessler_links">links</a></li>
    <li><a href="http://feeds.feedburner.com/dmiessler_itunes">itunes</a></li>
    <li><a href="http://feeds.feedburner.com/dmiessler_mobile_photos">mobile photos</a></li>
</ul>

<p>Links points to my Google Shared items from <a href="http://www.google.com/reader/">Google Reader</a>. So anything I mark as interesting there gets added to that feed. The iTunes feed includes the items I buy off of iTunes. The mobile photos feed points to <a href="http://gallery.mac.com/danielrm26#100051">my new .Mac Web Gallery</a>. I can upload to that online gallery (and update your feed) just by uploading a photo from my iPhone.</p>

<p>I&#8217;ve also redone my ad placement, re-added my <a href="http://push.cx/sociable">sociable</a> links, and added a considerable amount of content permanently to my <a href="http://dmiessler.com/writing/">/writing</a> page.</p>

<p>Let me know what you guys think of the changes&#8230;</p>
<div id="crp_related"><h3>Related Content</h3><ul><li><a href="http://danielmiessler.com/blog/feed-updates" rel="bookmark" class="crp_title">Feed Updates</a></li><li><a href="http://danielmiessler.com/blog/feeds-updated" rel="bookmark" class="crp_title">Feeds Updated</a></li><li><a href="http://danielmiessler.com/blog/feeds-borked" rel="bookmark" class="crp_title">Feeds Borked</a></li><li><a href="http://danielmiessler.com/blog/two-must-have-book-feeds" rel="bookmark" class="crp_title">Two Must-Have Book Feeds</a></li><li><a href="http://danielmiessler.com/blog/updated-rss-feed-locations" rel="bookmark" class="crp_title">Updated RSS Feed Locations</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://danielmiessler.com/blog/august-2007-site-enhancements/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

