<?xml version="1.0" encoding="UTF-8"?>
<guide>
  <body>&lt;h1&gt;Let GitHub do it for you&lt;/h1&gt;
&lt;p&gt;GitHub can directly import &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; projects. All you&amp;#8217;ll need is the repository &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;. More details are in the &lt;a href=&quot;http://github.com/blog/156-subversion-importing&quot;&gt;blog article&lt;/a&gt; that introduced the feature. Note: GitHub does not keep imported projects synchronized with the &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; repo.&lt;/p&gt;
&lt;h1&gt;Do it yourself&lt;/h1&gt;
&lt;h2&gt;svn2git&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/nirvdrum/svn2git&quot;&gt;svn2git&lt;/a&gt; is designed to provide a complete svn import.  Unlike git-svn, it will create proper git tags from your svn &amp;#8220;tags&amp;#8221;. Note: The current version of svn2git has GitHub support removed.&lt;/p&gt;
&lt;h2&gt;git-svn&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-svn.html&quot;&gt;git-svn&lt;/a&gt; can be used to import as well.  Note that there may be issues if you have branches or tags (they won&amp;#8217;t be imported over).  If you only have a trunk, like many svn repositories, this method should work for you without issue.&lt;/p&gt;
&lt;p&gt;First, be sure to &lt;a href=&quot;http://github.com/repositories/new&quot;&gt;create your repository on github&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;console&quot;&gt; $ git svn clone -s SVN_REPO_URL LOCAL_DIR
 $ cd LOCAL_DIR
 $ git remote add origin git@github.com:GITHUB_USERNAME/REPO_NAME.git
 $ git push origin master&lt;/pre&gt;
&lt;p&gt;Note that the -s switch implies that your svn repo is set up with the standard branches / tags / trunk structure.&lt;/p&gt;
&lt;p&gt;git-svn adds a note to every commit message it copies over from svn. To get rid of that note, add &lt;code&gt;--no-metadata&lt;/code&gt; to the git svn clone command&lt;/p&gt;
&lt;p&gt;You can pull in later commits by running &lt;code&gt;git-svn rebase&lt;/code&gt; from within your repo. (If you ever lose your local copy, just run the import again with the same settings, and you&amp;#8217;ll get another working directory with all the necessary &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; metainfo.).&lt;/p&gt;
&lt;h3&gt;Author mapping&lt;/h3&gt;
&lt;p&gt;When migrating a Subversion repository to Git, you can map the Subversion users to Git users. You have to create an authors file which contains the mappings:&lt;br /&gt;
&lt;pre&gt;fesplugas = Francesc Esplugas &amp;lt;fesplugas@intra&amp;#8230;.bles.net&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then clone the subversion repository with the previously created &lt;code&gt;authors-file&lt;/code&gt;:&lt;br /&gt;
&lt;pre class=&quot;console&quot;&gt;$ git svn &amp;#8212;authors-file=/home/fesplugas/.authors clone svn://intraducibles.net/var/svn/rails/plugins/something_fu something_fu&lt;/pre&gt;&lt;/p&gt;
&lt;h2&gt;Other guides&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/&quot;&gt;Guide by Jon Maddox&lt;/a&gt; (doesn&amp;#8217;t deal with branches)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.fnokd.com/2008/08/20/mirroring-svn-repository-to-github&quot;&gt;Guide by  Bob McWhirter&lt;/a&gt; (doesn&amp;#8217;t deal with branches)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://blog.woobling.org/2009/06/git-svn-abandon.html&quot;&gt;Guide by Yuval Kogman&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2008-02-15T14:36:04-08:00</created-at>
  <id type="integer">11</id>
  <permalink>import-from-subversion</permalink>
  <title>Import from Subversion</title>
  <updated-at type="datetime">2009-10-25T16:48:04-07:00</updated-at>
  <user-id type="integer">5364</user-id>
</guide>
