<?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>Guy Rutenberg &#187; svn</title>
	<atom:link href="http://www.guyrutenberg.com/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Wed, 16 Jun 2010 19:53:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Backup a SourceForge hosted SVN repository &#8211; sf-svn-backup</title>
		<link>http://www.guyrutenberg.com/2008/12/12/backup-a-sourceforge-hosted-svn-repository-sf-svn-backup/</link>
		<comments>http://www.guyrutenberg.com/2008/12/12/backup-a-sourceforge-hosted-svn-repository-sf-svn-backup/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 17:49:30 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=175</guid>
		<description><![CDATA[SourceForge urges their users to backup the code repositories of their projects. As I have several projects hosted with SourceForge, I should do it too. Making the backups isn&#8217;t complicated at all, but because it isn&#8217;t automated properly, I&#8217;ve been lazy with it.
sf-svn-backup was written in order to simply automate the process. The script is [...]]]></description>
			<content:encoded><![CDATA[<p>SourceForge urges their users to backup the code repositories of their projects. As I have several projects hosted with SourceForge, I should do it too. Making the backups isn&#8217;t complicated at all, but because it isn&#8217;t automated properly, I&#8217;ve been lazy with it.</p>
<p><a href="/wp-content/uploads/2008/12/sf-svn-backup.gz"><code>sf-svn-backup</code></a> was written in order to simply automate the process. The script is pretty simple to use, just pass as the first argument the project name and the script will write down to <code>stdout</code> the dump file.</p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sf-svn-backup openyahtzee &gt; openyahtzee.dump</pre></div></div>

<p>The project name should be it&#8217;s UNIX name (e.g. openyahtzee and not Open Yahtzee). Because the script writes the dump file directly to <code>stdout</code> it&#8217;s easy to pipe the output first through a compression program such as <code>gzip</code> to create compressed SVN dump files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2008/12/12/backup-a-sourceforge-hosted-svn-repository-sf-svn-backup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Delete Unversioned Files Under SVN</title>
		<link>http://www.guyrutenberg.com/2008/01/18/delete-unversioned-files-under-svn/</link>
		<comments>http://www.guyrutenberg.com/2008/01/18/delete-unversioned-files-under-svn/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 10:20:36 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/2008/01/18/delete-unversioned-files-under-svn/</guid>
		<description><![CDATA[Sometimes svn switch fails because unversion files exist in the working copy, and the need to erase them comes up. This is also true when updating to an old revision (usually one that misses directories that exist in the head revision), doing some work (like compiling), and then trying to update back to the head [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes <code>svn switch</code> fails because unversion files exist in the working copy, and the need to erase them comes up. This is also true when updating to an old revision (usually one that misses directories that exist in the head revision), doing some work (like compiling), and then trying to update back to the head revision. Subversion (SVN) will fail complaining that directories/files already exist.<br />
<span id="more-37"></span><br />
The cause of the problem is that the working-copy isn&#8217;t clean, it has some (or a lot) of unversioned files. The best solution will be to delete all of them. While this can be a tedious task when done manually for each file, it can be achieved with single shell command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> status <span style="color: #660033;">--no-ignore</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'^\?'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/^\?      //'</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> status <span style="color: #660033;">--no-ignore</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'^\?'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/^\?      //'</span>  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span></pre></div></div>

<p>The first command will list all unversioned files and directories. Use this to review the files to be deleted. After you review the files, use the second command to delete them easily. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2008/01/18/delete-unversioned-files-under-svn/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Creating Local SVN Repository (Home Repository)</title>
		<link>http://www.guyrutenberg.com/2007/10/29/creating-local-svn-repository-home-repository/</link>
		<comments>http://www.guyrutenberg.com/2007/10/29/creating-local-svn-repository-home-repository/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 06:39:36 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/10/29/creating-local-svn-repository-home-repository/</guid>
		<description><![CDATA[In this tutorial I will explain how to create a local Subversion (SVN) repository, intended for a single user. I assume that you already know the benefits of keeping track of old revision of projects or important documents such as a resume or a thesis you have been writing. Subversion offers you a very convenient [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I will explain how to create a local Subversion (SVN) repository, intended for a single user. I assume that you already know the benefits of keeping track of old revision of projects or important documents such as a resume or a thesis you have been writing. Subversion offers you a very convenient yet strong method to do so, and the easiest way to do so with Subversion (SVN) is to create a local, home, repository intended for a single user &#8211; you.<br />
<span id="more-26"></span><br />
The repository we are going to create will be used by a single user, working locally on the machine. In this tutorial I will assume the repository will be created for a project called &#8220;project1&#8243;. &#8220;project1&#8243; can be a real project you are doing, a paper you are writing or any thing else that can be stored under revision control (that almost everything).</p>
<h4>Creating the repository</h4>
<p>We will start by creating the repository. From the command line do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ mkdir /home/user/svnrep
$ cd ~/svnrep
$ svnadmin create project1</pre></div></div>

<p>In the first line we create a directory to house all of your repositories (I assume you are working under the username &#8220;user&#8221;). I prefer to use different repositories for different projects that are unrelated, no matter how small they are. Because I use many repositories, I prefer to have a single directory  underneath all repositories will reside in an organized way (i.e. no junk files or any other kind of stuff except directories). Next thing, is to <code>cd</code> into the directory we created, and actually create the repository using the <code>svnadmin</code> command. To repository we&#8217;ve created is called &#8220;project1&#8243;. </p>
<p>The brand new &#8220;project1&#8243; repository is currently empty and in revision 0. This will change once we put some data in it. The first thing you do with a new repository is to import initial project data into it.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ svn import /home/user/project1 file:///home/user/svnrep/project1/trunk -m &quot;Initial import of project1&quot;</pre></div></div>

<p>Will import the current project1&#8217;s file into the repository (assuming that project1 indeed resides in <code>/home/user/project1</code>). The </code>trunk</code> appended to the end of the repository URL, is part of the directory layout convention used by many Subversion users. The last part of the command is the message that will be attached to the import in the SVN log.</p>
<p>Now the repository holds data and you are ready to checkout the code from it, and start working.</p>
<h4>Checkout a Working Copy and Start Working</h4>
<p>When using SVN (as well as in most revision control systems) you don't work directly on the repository. Instead you checkout a working copy from it, and work on this copy. To checkout a working copy from the repository, use:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ svn co file:///home/user/svnrep/project1/trunk /home/user/project1_work</pre></div></div>

<p>This will create a working copy of the repository under <code>/home/user/project1_work</code>. You can edit this copy safely. </p>
<p>After you've done editing your working copy, you will want to commit those changes back to the repository. Assuming you are already inside the directory of the working copy, just do:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ svn commit -m &quot;Some log message&quot;</pre></div></div>

<p>This will send you changes back to the repository and store them there. Change the "Some log message" to some useful short description of the changes you've made.</p>
<h4>Some Useful Commands</h4>
<p>To view a list of log messages that were attached to the operations on the repository, use:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ svn log
$ svn log -r 5:HEAD</pre></div></div>

<p>The first command will print all log messages. The second command will print the log messages from revision 5 to the latest revision. You can substitute the <code>HEAD</code> with a number to get the log messages of the revisions up to a specific one.</p>
<p>To view the changes you made before committing your code, use:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ svn diff</pre></div></div>

<p>Another important command is the one to update your working copy with the latest revision from the repository. This can be done using:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ svn update</pre></div></div>

<p>However, since your are the only user of the local repository, you won't have to use this function often (if at all), unless you use two, or more, working copies for your project.</p>
<p>This concludes this tutorial. I hope you know by now how to create and use, a single user local SVN repository. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2007/10/29/creating-local-svn-repository-home-repository/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.475 seconds -->
