<?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>Rails on the Run &#187; scm</title>
	<atom:link href="http://railsontherun.com/tag/scm/feed/" rel="self" type="application/rss+xml" />
	<link>http://railsontherun.com</link>
	<description>Rails experiments by Matt Aimonetti</description>
	<lastBuildDate>Tue, 23 Feb 2010 07:28:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>resolving git-svn conflicts</title>
		<link>http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts/</link>
		<comments>http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 22:40:00 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git-svn]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts</guid>
		<description><![CDATA[I&#8217;ve been using git and git-svn for a little while and never had a problem&#8230; until today. On one of my project, we have a SVN repo but since I prefer using Git, I&#8217;m using git-svn. Git-svn has been great, it let me create my own local branches for each new set of features (that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://git.or.cz/">git</a> and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a> for a little while and never had a problem&#8230; until today.</p>
<p>On one of my <a href="http://gumgum.com">project</a>, we have a SVN repo but since I prefer using Git, I&#8217;m using git-svn.</p>
<p>Git-svn has been great, it let me create my own local branches for each new set of features (that&#8217;s when I don&#8217;t forget to create a branch) and to commit all the changes back to svn.</p>
<p>The problem today happened after I did a simple git-svn rebase. I had some sort of error and my local repo looked like it got reverted to the head of the svn repo&#8230;. </p>
<pre><code>error: patch failed: trunk/app/models/view.rb:1
error: trunk/app/models/view.rb: patch does not apply
[blah blah]
sing index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
</code></pre>
<p>I hadn&#8217;t committed to SVN for 24 hours and had a lot of work that was just checked in locally&#8230; You can imagine the panic.  <a href="http://notch8.com">Rob</a> started digging in the .git repo to finally find the hash representing the latest delta before the rebase. With the help of the #caboose guys, I did a simple</p>
<pre><code>git reset --hard hash-name
</code></pre>
<p>Which restore my repo to the pre SVN commit state. Awesome&#8230; however I still had issues to commit my stuff. After a little while I as able to commit again, worked a bit more and tried to commit again&#8230;. same error <img src='http://railsontherun.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>But this time I noticed I could simply do</p>
<pre><code>git rebase --abort
</code></pre>
<p>to restore the original branch.an </p>
<p>But I still couldn&#8217;t commit properly&#8230; until I discovered that I just needed to fix the conflicts manually using</p>
<pre><code>git-mergetool
</code></pre>
<p>git-mergetool uses whichever merge tool available: kdiff3 tkdiff xxdiff meld gvimdiff opendiff emerge vimdiff filemerge</p>
<p>I fixed my conflicts in no time, then did a </p>
<pre><code>git rebase --continue
</code></pre>
<p>and finally</p>
<pre><code>git-svn dcommit
</code></pre>
<p>Looking back, I wish I knew how to properly deal with conflicts when using git-svn, I wasted a bit of my precious time <img src='http://railsontherun.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   hopefully this post will help you.</p>
<p>p.s:  <a href="http://brian.maybeyoureinsane.net/blog/2008/01/31/git-sake-tasks/">here</a> is an interesting use of Sake to handle git-svn</p>
]]></content:encoded>
			<wfw:commentRss>http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

