<?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; vcs</title>
	<atom:link href="http://solutions.unixsherpa.com/tag/vcs/feed/" rel="self" type="application/rss+xml" />
	<link>http://solutions.unixsherpa.com</link>
	<description>by Dan Reiland</description>
	<lastBuildDate>Fri, 16 Apr 2010 20:28:57 +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>Recursively delete .svn directories</title>
		<link>http://solutions.unixsherpa.com/2009/04/10/recursively-delete-svn-directories/</link>
		<comments>http://solutions.unixsherpa.com/2009/04/10/recursively-delete-svn-directories/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 20:17:02 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[SCM]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://solutions.unixsherpa.com/?p=56</guid>
		<description><![CDATA[Abstract This is a simple example of a unix command, which recursively deletes subversion .svn folders. Subversion is a well-spread open-source revision control application. Every copy of source code received from subversion repository has .svn folders, which store metadata. However, if you want to use or distribute source code for end-user consumption, these folders are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Abstract</strong></p>
<p>This is a simple example of a unix command, which recursively deletes subversion .svn folders. Subversion is a well-spread open-source revision control application. Every copy of source code received from subversion repository has .svn folders, which store metadata. However, if you want to use or distribute source code for end-user consumption, these folders are not necessary. A simple svn export [repository] is suitable.</p>
<p><strong>Compatible </strong><span> </span></p>
<ul>
<li>Linux, FreeBSD, Mac OS X, Cygwin...</li>
<li>Nearly any unix-compatible system with rm and find</li>
</ul>
<p>We use find command to find all .svn folders beginning from current directory.</p>
<pre>
$ find . -type d -name .svn
</pre>
<pre>
./.svn
./sourceA/.svn
./sourceB/.svn
./sourceB/module/.svn
./sourceC/.svn
</pre>
<p>It is possible to pass these directories directly to rm command, using grave accent quotes (key to left of '1')</p>
<pre>
$ rm -rf `find . -type d -name .svn`
</pre>
<p>So, this will remove every .svn folder beginning from current directory.</p>
<p><strong>Source code: bash script</strong></p>
<pre>
#!/bin/sh

echo "recursively removing .svn folders from"
pwd
rm -rf `find . -type d -name .svn`
</pre>
<p>You may save this script to /usr/bin/csvn (or other binary folder included in path) and use later to get 'clean' project source without typing lengthy commands.</p>
<p>For example,</p>
<pre>
$ svn checkout svn://server.com/svn/project
A    project/index.php
A    project/sourceA/a.php
A    project/sourceA/a1.php
A    project/sourceA/a2.php
A    project/sourceB/b.php
A    project/sourceB/module/lib.php
A    project/sourceC/c.php
Checked out revision 15.

$ cd project
$ csvn
</pre>
<p><strong>Warning</strong><br />
<em>Always check you current working directory before calling 'csvn'.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://solutions.unixsherpa.com/2009/04/10/recursively-delete-svn-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 1/15 queries in 0.203 seconds using disk
Object Caching 291/309 objects using disk

Served from: solutions.unixsherpa.com @ 2010-09-06 06:37:42 -->