One working copy to rule them all (Git + SVN)

I started moving my open source code over to GitHub, since it supports working with contributors in a natural, but controlled manner. However, for many of my WordPress plugins I already have a local working copy, since they are hosted in the WordPress plugin repository to support auto-update. I didn’t want to disrupt my svn working copy, nor did I want to start fresh in github.

So this is how I did it:

  1. Create a new repos on github, and import the SVN repos from wp-plugins.org into github
  2. Move your local working copy to a new directory: mv workingcopy/ workingcopy.svn/
  3. Clone your new github repos after the import is completed (which may take a while, since the plugin repos is shared by all plugins and has thousands of commits): git clone git@github.com:user/repos.git
  4. Once cloned, move the .git folder into your workingcopy.svn folder
  5. Then just ignore .svn folders with .gitignore and ignore .git with svn:ignore
  6. Now you can use git for your main development, and check tested changes into SVN to push your updates out to your Plugin users

There may be another way to go about this, but it wasn’t obvious to this hacker.

2 Responses to “One working copy to rule them all (Git + SVN)”


Leave a Reply