<?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>Brain Matters &#187; bzr</title>
	<atom:link href="http://blog.agoragames.com/tag/bzr/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.agoragames.com</link>
	<description></description>
	<lastBuildDate>Mon, 16 Aug 2010 19:36:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bzr to Git Migration</title>
		<link>http://blog.agoragames.com/2010/03/08/bzr-to-git-migration/</link>
		<comments>http://blog.agoragames.com/2010/03/08/bzr-to-git-migration/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 16:44:35 +0000</pubDate>
		<dc:creator>Abhishek Mukherjee</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[bzr]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=486</guid>
		<description><![CDATA[When I joined Agora, one of the first things I did was talk up git and how it&#8217;ll cure cancer, AIDS, and solve world peace. All at once. What that means for me is I&#8217;ve basically been tasked with the job of migrating anything that&#8217;s not git to git.
For some things these kinds of migration [...]]]></description>
			<content:encoded><![CDATA[<p>When I joined Agora, one of the first things I did was talk up <a href="http://git-scm.com">git</a> and how it&#8217;ll cure cancer, AIDS, and solve world peace. All at once. What that means for me is I&#8217;ve basically been tasked with the job of migrating anything that&#8217;s not git to git.</p>
<p>For some things these kinds of migration are first class citizens. Conveniently SVN, our old VCS is one of those. One of my new migrations was, less conveniently, <a href="http://bazaar.canonical.com/">Bazaar</a>. Now we have nothing against Bazaar at Agora. I mean my main personal open source project, <a href="http://exaile.org/">Exaile</a>, uses Bazaar. But we agreed we would rather only have one VCS in house.</p>
<p>After looking around and trying some fancy tools that didn&#8217;t work (read: tailor), I stumbled on a really quick solution that seems like it does everything necessary. Both Git and Bazaar (via plugins) support the fast-import/export format. I&#8217;m not sure about the mystic ways of how this format works but I do know it made my Bazaar repository a Git repository, and that makes me pleased.</p>
<h2>Getting the bzr plugin</h2>
<p>The first step would be to get the fast-import plugin for Bazaar from the launchpad mirror.</p>
<pre class="brush: bash">
mkdir -p ~/.bazaar/plugins
cd ~/.bazaar/plugins
bzr clone lp:bzr-fastimport fastimport
</pre>
<p>You can make sure it installed properly using a <code>bzr fast-export --help</code> and ensure that it doesn&#8217;t complain.</p>
<h2>Copy the repository</h2>
<p>Now that we have all the tools, time to copy it over</p>
<pre class="brush: bash">
mkdir ~/project.git
cd ~/project.git
git init
bzr fast-export --plain ~/path/to/bzr/branch | git fast-import
git checkout master  # only needed for a non-bare repository, like I made above
</pre>
<p>Wait a little while (or a long while if you&#8217;re testing the above code on a netbook for some reason like me). And that should be it.</p>
<p>I&#8217;m not sure how well this works with multiple Bazaar branches. There may be some crazy <code>--flags</code> on each side to make it work but running the code I put above on a full repo makes fast-export complain that I&#8217;m not pointing it to a valid branch. Please give us your comments if you know how to do this :). </p>
<p><strong>Update:</strong> Found out it was .bazaar not .bzr. My bad.</p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F03%2F08%2Fbzr-to-git-migration%2F&amp;title=Bzr%20to%20Git%20Migration" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F03%2F08%2Fbzr-to-git-migration%2F&amp;title=Bzr%20to%20Git%20Migration&amp;bodytext=When%20I%20joined%20Agora%2C%20one%20of%20the%20first%20things%20I%20did%20was%20talk%20up%20git%20and%20how%20it%27ll%20cure%20cancer%2C%20AIDS%2C%20and%20solve%20world%20peace.%20All%20at%20once.%20What%20that%20means%20for%20me%20is%20I%27ve%20basically%20been%20tasked%20with%20the%20job%20of%20migrating%20anything%20that%27s%20not%20git%20to%20git.%0D%0A%0D%0A" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F03%2F08%2Fbzr-to-git-migration%2F&amp;title=Bzr%20to%20Git%20Migration&amp;notes=When%20I%20joined%20Agora%2C%20one%20of%20the%20first%20things%20I%20did%20was%20talk%20up%20git%20and%20how%20it%27ll%20cure%20cancer%2C%20AIDS%2C%20and%20solve%20world%20peace.%20All%20at%20once.%20What%20that%20means%20for%20me%20is%20I%27ve%20basically%20been%20tasked%20with%20the%20job%20of%20migrating%20anything%20that%27s%20not%20git%20to%20git.%0D%0A%0D%0A" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.agoragames.com%2F2010%2F03%2F08%2Fbzr-to-git-migration%2F&amp;t=Bzr%20to%20Git%20Migration" title="Facebook"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.agoragames.com%2F2010%2F03%2F08%2Fbzr-to-git-migration%2F&amp;t=Bzr%20to%20Git%20Migration&amp;s=When%20I%20joined%20Agora%2C%20one%20of%20the%20first%20things%20I%20did%20was%20talk%20up%20git%20and%20how%20it%27ll%20cure%20cancer%2C%20AIDS%2C%20and%20solve%20world%20peace.%20All%20at%20once.%20What%20that%20means%20for%20me%20is%20I%27ve%20basically%20been%20tasked%20with%20the%20job%20of%20migrating%20anything%20that%27s%20not%20git%20to%20git.%0D%0A%0D%0A" title="Tumblr"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Bzr%20to%20Git%20Migration%20-%20http%3A%2F%2Fblog.agoragames.com%2F2010%2F03%2F08%2Fbzr-to-git-migration%2F" title="Twitter"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2010/03/08/bzr-to-git-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->