<?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>Ramblings of a Geek - Jeremy Johnstone &#187; svn</title>
	<atom:link href="http://www.jeremyjohnstone.com/tag/svn/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jeremyjohnstone.com</link>
	<description>Ramblings of a Geek</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:33:00 +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>Using git-svn with non-standard subversion repository layouts</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html#comments</comments>
		<pubDate>Thu, 14 Jan 2010 07:01:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[stdlayout]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=1508</guid>
		<description><![CDATA[Today while working with a 3rd party&#8217;s codebase, I ran into a situation which git-svn could not directly handle without pulling in massive amounts of unnecessary repository history. Turns out the solution was much simpler than I anticipated, so I&#8217;m sharing here in case it&#8217;s useful for somebody else. The repository was as follows:

http://svn.domain.org/svn/trunk/&#60;project_name&#62; -- [...]]]></description>
			<content:encoded><![CDATA[<p>Today while working with a 3rd party&#8217;s codebase, I ran into a situation which git-svn could not directly handle without pulling in massive amounts of unnecessary repository history. Turns out the solution was much simpler than I anticipated, so I&#8217;m sharing here in case it&#8217;s useful for somebody else. The repository was as follows:</p>
<pre>
http://svn.domain.org/svn/trunk/&lt;project_name&gt; -- Production branch
http://svn.domain.org/svn/branches/&lt;project_name&gt; -- Development branch
</pre>
<p><br/></p>
<p>I tried a number of approaches. First off, using the normal &#8211;stdlayout option with http://svn.domain.org/svn repository root to git-svn clone would have pulled in thousands of changesets from the repository which had nothing to do with the project I was working on.</p>
<p>Next I tried to use &#8211;trunk=trunk/&lt;project_name&gt; and &#8211;branches=branches/&lt;project_name&gt; and unfortunately this method tried to create a new branch for every child directory of branches/&lt;project_name&gt;. Obviously this wasn&#8217;t what I wanted either.</p>
<p>After doing a bit of searching on the web, I stumbled across another solution via <a title="Multiple branches using git-svn" href="http://www.dmo.ca/blog/20070608113513/" target="_blank">this blog</a>. Basically what it suggests doing is to use a separate svn-remote for the alternative path. This conveniently works around the issue quite nicely without any side-effects I&#8217;ve run into so far. Here&#8217;s the steps I followed:</p>
<ol>
<li>git svn clone http://svn.domain.org/svn/ &#8211;trunk=trunk/&lt;project_name&gt; &lt;project_name&gt;</li>
<li>cd &lt;project_name&gt;</li>
<li>vim .git/config</li>
<li>Add an additional remote as follows:<br/>
<pre>[svn-remote "svndev"]<br/>url = http://svn.domain.org/svn/<br/>fetch = branches/&lt;project_name&gt;:refs/remotes/dev</pre>
</li>
<li>git svn fetch svndev</li>
<li>git checkout -b dev remotes/dev</li>
</ol>
<p>After following those steps, you now have a new remote &#8216;remotes/dev&#8217; which is a copy of the dev environment branch from the repository and a new local branch called &#8220;dev&#8221;. You should now be able to proceed like normal using your usual git-svn workflow.</p>
<p>Of course the obvious answer would be to use standard repository layouts or to not use Subversion and/or git-svn, but sometimes that&#8217;s not always an option. I hope this helps someone stuck in a similar situation. Also, please be sure and sound off in the comments if you find an alternative solution!</p>
<p>Update:<br />
Here are a <a href="http://kerneltrap.org/mailarchive/git/2008/6/26/2241084" target="_blank" title="git mailing list">couple</a> <a href="http://kerneltrap.org/mailarchive/git/2008/6/26/2241154" target="_blank" title="git mailing list">additional</a> <a href="http://kerneltrap.org/mailarchive/git/2008/6/27/2243984" target="_blank" title="git mailing list">links</a> which might prove useful depending on your desired workflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

