There are quite a few blog posts about how to import a Subversion repository into git. Simplistic Complexity’s write-up is the best I’ve seen on how to do it cleanly. Here is a quick summary of the steps:
mkdir temp_repos; cd temp_repos
# init the git repository, do not import quite yet
git-svn init svn://repository_goes_here# specify mapping from svn users to git users
git config svn.authorsfile ~/authors.txt# start the import, it may take a while
git-svn fetchcd ..; git clone temp_repos clean_repos
rm -rf temp_repos; cd clean_repos
# enjoy working with git
If you would like more detail, especially about the mapping of users with authors.txt, please refer to the original article.
8 Comments
Did you completely forget that you have to apt-get install git-svn or did you just intentionally leave that out?
How about putting some attention into your blog posts and being thorough, makes for a less frustrating read when someone’s trying to follow your half-ass instructions and you’ve entirely missed a step.
click170: Good point: if you don’t have a piece of software, you do indeed need to install it before you can use it for fun and profit. You do realize, however, that not everyone uses apt-get?
click170 is right, David. You completely leave out how the Subversion repository was setup, the OS-specific instructions for installing Subversion, and the instructions for installing the OS on my machine. Please stop writing half-assed blog posts.
do i need a computer for this? where can I get one?
seriously what the hell.
ever tried “git help” ? you will probably find that the 170 different commands mostly merged from “git-something” into “git something”.
Do i need 0.02 $ for this? where do i get those?
Well ignoring Click170 and Jeremy completely (seriously – take a bit of responsibility guys for educating yourselves. He didn’t mention you needed linux either – or git – or several other steps like knowing how to use bash). Just to say thanks for this – I’d spent quite a long time trying to get git-svnimport to work and couldn’t – this worked like a charm! Thanks!
Ignore the Jeremy bit on the last post – but keep Click170 on (sorry Jeremy – read your post too quickly!)
This does not work on my iPad. YOU WRITE TERRIBLE BLOG POSTS!
One Trackback/Pingback
[...] http://djwonk.com/blog/2008/05/09/cleanly-import-svn-repository-into-git/ [...]
Post a Comment