Update: Since I wrote this, I found out the git-svnimport is deprecated. The good news is that the process is now much easier!
I started importing a bunch of our Rails plugins into GitHub this morning.
I used git-svnimport because I want the entire svn history converted to git.
A couple of issues proved problematic:
<pre>rails/plugins/acts_as_audited
rails/plugins/acts_as_geocodable
…
rails/plugins/with_action
</pre>
<pre>git svnimport -T plugins/acts_as_audited http://source.collectiveidea.com/public/rails</pre>
<pre>username = User's Full Name <[email protected]></pre>
and pass -A path_to_author_file<pre>git svnimport -T plugins/acts_as_audited -A ./authors http://source.collectiveidea.com/public/rails</pre>
<pre>git svn clone http://source.collectiveidea.com/public/rails/acts_as_audited -A ./authors</pre>
<pre>git svnimport -C acts_as_audited -T plugins/acts_as_audited -A ./authors http://source.collectiveidea.com/public/rails</pre>
That’s it! After that, you have a git copy of your repository and can push it to GitHub, or do whatever you want.
Here’s the final command for reference (I added -v for verbose):
<pre><del>git svnimport -v -C acts_as_audited -T plugins/acts_as_audited -A ./authors http://source.collectiveidea.com/public/rails</del>
<ins>git svn clone http://source.collectiveidea.com/public/rails/acts_as_audited -A ./authors </ins></pre>
<pre>git svnimport -v -C acts_as_audited -T plugins/acts_as_audited -A ./authors http://source.collectiveidea.com/public/rails</pre>
<pre>git svn clone http://source.collectiveidea.com/public/rails/acts_as_audited -A ./authors </pre>
You may get some errors like W: Ignoring error from SVN, path probably does not exist:
and HTTP Path Not Found: REPORT request failed
. These are fine. Ignore them.
Check out our projects on GitHub.
Kevin Ballard — February 17, 2008
You really should use git-svn, not git-svnimport. The latter has been deprecated.
Daniel Morrison — February 18, 2008
Kevin: Yep, I found out it was deprecated a couple days after posting this.
I hadn’t updated to git 1.5.4 yet, so I guess I should rework these instructions.
ggg — August 29, 2008