<?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>Dev-Blog of DoesntMatter &#187; Svn2Git</title>
	<atom:link href="http://dev-blog.doesntmatter.de/tag/svn2git/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev-blog.doesntmatter.de</link>
	<description>Software technologies, tips, guides and tutorials</description>
	<lastBuildDate>Sun, 29 Apr 2012 12:57:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>HowTo: Convert Subversion to Git</title>
		<link>http://dev-blog.doesntmatter.de/2012/03/19/howto-convert-subversion-to-git/</link>
		<comments>http://dev-blog.doesntmatter.de/2012/03/19/howto-convert-subversion-to-git/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 12:50:20 +0000</pubDate>
		<dc:creator>DoesntMatter</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[VCS]]></category>
		<category><![CDATA[git-svn]]></category>
		<category><![CDATA[Svn]]></category>
		<category><![CDATA[Svn2Git]]></category>

		<guid isPermaLink="false">http://dev-blog.doesntmatter.de/?p=490</guid>
		<description><![CDATA[To make a start I can say that I personally prefer using Git as Version Control System. I use Subversion and Mercurial for some reasons too, but I do not really like to work with them. Because of this I &#8230; <a href="http://dev-blog.doesntmatter.de/2012/03/19/howto-convert-subversion-to-git/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To make a start I can say that I personally prefer using <a href="http://git-scm.com/" title="Git" target="_blank">Git</a> as Version Control System. I use <a href="http://subversion.apache.org/" title="Subversion" target="_blank">Subversion</a> and <a href="http://mercurial.selenic.com/" title="Mercurial" target="_blank">Mercurial</a> for some reasons too, but I do not really like to work with them.</p>
<p>Because of this I wanted to convert some Subversion repositories to Git. If you also have planned to do this, the following may help you.</p>
<p><u><strong>Three different ways for the conversion:</strong></u></p>
<ol>
<li><u>Copying the source code:</u></li>
<p>The <strong>easiest and fastest</strong> way is simply copying the source code into an empty Git repository. For me this solution was impracticable, because you will <strong>loose the history</strong>.<br />
<code><br />
<em># Create and switch to new folder</em><br />
mkdir $GIT_REPO<br />
cd $GIT_REPO</p>
<p><em># Copy all files from the Subversion directory</em><br />
<em># Use -C option to ignore .svn directories</em><br />
rsync -C $PATH_TO_SVN_REPO/* $PATH_TO_GIT_REPO/</p>
<p><em># Do the Git steps</em><br />
git init<br />
git add *<br />
git commit -asm "Initial commit"<br />
</code></p>
<li><u>Using git-svn:</u></li>
<p>The next way to convert the repository is using <strong>git-svn</strong>. With git-svn you are able to adopt <strong>all branches</strong> and the <strong>whole history</strong>. The only <strong>unsuitable thing is converting tags</strong>, because they are created as branches by default and you need to switch them manually afterwards.<br />
<code><br />
<em># Install the software</em><br />
(sudo) apt-get install git-svn</p>
<p><em># Make and switch to new folder</em><br />
mkdir $GIT_FOLDER<br />
cd $GIT_FOLDER</p>
<p><em># Convert the repository</em><br />
git svn clone $SVN_URL --no-metadata --stdlayout .</p>
<p><em># Update the repository</em><br />
git svn fetch<br />
</code></p>
<li><u>Using svn2git:</u></li>
<p><a href="https://github.com/nirvdrum/svn2git" title="svn2git" target="_blank">Svn2git</a> is a utility which uses git-svn internally to do the real conversion, but in addition it does some more jobs around this to perfect the system. With this you will have a <strong>accurate converted repository</strong>. It uses Ruby, so you need to install some additional packages.<br />
You can use svn2git for some special actions and custom purposes. If you need some more information you can take a look at the <a href="https://github.com/nirvdrum/svn2git/blob/master/README.markdown" title="svn2git README" target="_blank">README</a>.<br />
<code><br />
<em># Install the software</em><br />
(sudo) apt-get install git-svn ruby rubygems<br />
(sudo) gem install svn2git</p>
<p><em># Make and switch to new folder</em><br />
mkdir $GIT_FOLDER<br />
cd $GIT_FOLDER</p>
<p><em># Convert the repository</em><br />
svn2git $SVN_URL</p>
<p><em># Update the repository</em><br />
svn2git --rebase<br />
</code>
</ol>
<p>I hope this tutorial helps you to save some time and troubles. If you have feedback, regards, corrections or questions please let me know and do not hesitate to comment!</p>
<p>I will probably write something about Version Control Systems, like a comparison or Cheat-Sheets, in other blog posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-blog.doesntmatter.de/2012/03/19/howto-convert-subversion-to-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
