Background
Today my third WordPress plugin has been approved and added to the WordPress Plugins directory. A usual action after your plugin submission has been approved, is to push the code to the WordPress SVN repository. I must confess that I was never able to memorize all the commands and steps to push the code. I am very good at Git and using it because I have been using it for more than 12 years! However, I suck at SVN and its command! Therefore, I decided to write this small how-to in the first place to help myself and also other people like me who always struggle with remembering the right commands in the right order.
Disclaimer: WordPress has a nice guide for this, but I find it too detailed. It could be good for people who use it for the first time, but it is definitely a burden if you know what you want and do, but you only need the commands!
For this how-to item, I assume you have already installed SVN on your Ubuntu/Unix-based machine. In addition, I will be using the slug of my accepted plugin as an example here, you have to use your own!
The steps
- Have the SVN link to the plugin by hand. The link is usually sent by the WordPress review team upon acceptance. In my case it was https://plugins.svn.wordpress.org/webkew-image-dominant-color-generator . Notice the
svn
in the URL. - From the command line execute the following command
svn co https://plugins.svn.wordpress.org/webkew-image-dominant-color-generator
this will create a folder with the namewebkew-image-dominant-color-generator
. This command will create three sub-foldersassets
tags
andtrunk
- Enter the newly created directory
cd webkew-image-dominant-color-generator/
- Move your plugin code to the
trunk
folder. - Move the assets that belong to your plugin to the
assets
folder. - Execute
svn add trunk/*
andsvn add assets/*
- Execute
svn ci -m "YOUR MESSAGE"
to commit the changes of both folders to the SVN repository (You can skip this step if you are tagging a new version) - Execute
svn cp trunk tags/1.0.0
to copy the content of the trunk to the subfolder 1.0.0 within the tags folder. You do this to tag a version of your code before you publish it to the WordPress Plugins directory. - Finally, execute
svn ci -m "Tagging version 1.0.0"
You may be asked at some point to enter your WordPress credentials to be able to push to the repository, don’t panic, just provide your password when asked, and then you are good to go!
UPDATE:
I have been coming to this post over and over again whenever I want to push code changes or I want to publish a new WordPress plugin.