WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I develop my plugin over on github but when it comes to deployment I have to somehow copy my changes into the Wordpress SVN. Currently I do this manually and copy over each file in each directory individually, but this is time consuming and error prone.

I have seen and tried a few scripts but I think I must be running them wrong as they either error or don't copy over the files correctly.

So my question is has anyone achieved this automatically and if so how did you do it?


share|improve this question
While I think this is interesting and useful question it also falls out of scope since it's about interaction of Git and Subversion and there is nothing about it specific to WordPress. I need to think what would be best action here... – Rarst Jan 25 '12 at 21:20
I have started question on meta to discuss this case. – Rarst Jan 25 '12 at 21:34
@Rarst thanks for that, sorry for misplacing the question – studioromeo Jan 25 '12 at 23:39

see this tutorial from a co-worker of my team: http://www.farbeyondprogramming.com/2011/09/81-how-to-deploy-a-wordpress-plugin-with-git-svn

but he don`t use the solution, its easier to work separate :(

share|improve this answer
Thanks @bueltge. So am I right in thinking he has reverted to the manual method? – studioromeo Jan 25 '12 at 23:44
For the love of all that is holy, do not follow the instructions on that site. If you suddenly make hundreds of commits to our SVN, I will personally make it my life's goal to find you and beat you with a stick. Or maybe just ban you from WordPress.org. ;) Please only commit the final version, not each and every single one of your changes that you committed to git. We do value your history, but only meaningful history. The problem with git is that people commit loads of useless crap, and we don't need to know all that stuff, generally speaking. – Otto Jan 26 '12 at 0:19
@Otto Lol! No I simply just want to be able to deploy my changes to the SVN repo. Currently do this manually overwriting files in my checked out svn repo but thats tedious & error prone. Do you have any suggestions? – studioromeo Jan 26 '12 at 0:33
Doing an interactive rebase of your Git changes will let you combine them into a single SVN commit. More info on how to do this is here: stackoverflow.com/questions/158514/… – Otto Jan 26 '12 at 0:36
@Otto I see, seems there is also merge --squash which may be less time consuming. So if I'm right.. workflow is: 1. git merge --squash / rebase -i 2. git svn rebase 3. git svn dcommit 4. git svn tag '1.0' – studioromeo Jan 26 '12 at 0:41

After reading these responses, I pushed one of my plugins to GitHub and wrote a release.sh script. This script gets a partial checkout of my plugin from plugins.svn.wordpress.org using --depth immediates, and updates the files in trunk/ and assets/. This should simplify a periodic push to svn, using the wordpress.org repository to tag releases rather than maintain development history:

svn cp trunk tags/0.6
svn ci "Sending 0.6 from https://github.com/foo/bar to wordpress.org"

A more generic version might work with a wider variety of plugins, handle deleted files, and update svn tags automatically based off git tags.

share|improve this answer

See How to Publish a WordPress Plugin – Git from @EAMann for a detailed description.

share|improve this answer
If you're going to do this sort of thing, please do an interactive rebase and then change all the commits to be squashed, so that you don't make dozens of small commits to the SVN servers. More info on how to do this is here: stackoverflow.com/questions/158514/… – Otto Jan 26 '12 at 0:33
@Otto While I totally understand your wish to reduce the server load :) I really, really love atomic commits if I have to debug other people’s code. Hm … an automatic link to a public Git repository with a complete commit history could be a useful enhancement for the plugin directory. – toscho Jan 26 '12 at 1:27
Gotta agree with @Otto about this. WordPress.org's SVN should really be the release repository, not the development repository. – MikeSchinkel Jan 26 '12 at 13:30

I don't do it automatically, but it's pretty simple:

Have SVN truck and Git master checked out in the same directory. Use Git for almost everything, as one would with any Git-only project.

Set the stable tag to be trunk, and then when ready to do a release, tag it in Git and then immediately push to trunk. Don't worry about pushing to SVN /tags, as your release history is safe in Git (and Github).

That's about it.

To clean it up, I add .svn to .gitignore, and .git (and tests/, phpunit.xml, etc.) to be ignored by SVN.

A release.sh script would really be nothing more than the following (once the version number in code has been updated, and all committed to Git):

git tag $1
svn ci -m"Release: $1"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.