SVN delete: Removing a folder in WordPress Repository plugin/theme

I struggled with trying to remove a misplaced folder in a plugin I had submitted to the WordPress repository. Little did I know that SVN and Git both as version control systems work differently. Ordinarily, deleting a folder physically using your default computer system GUI will cause you Git repo to register a new change in the unstaged parts. In other words you can track the changes in your files. Ideally your next step in the terminal would be:

git add * && git commit -m “Removing file x” 

And you are good to go. However, in SVN world things work in code universe. Also to note, this is not shared on the WordPress documentation on how to use svn subversion.

If you don’t have your svn repo updated on your computer, you can pull it front the source. In this example, we shall run with the WordPress plugin. First, we need to request for the plugin files in our local computer.via the terminal/command prompt.

svn co name-holding-directory

Next, we navigate into the retrieved directory holding our files. The above call will return the whole svn repository with the directories inside our holding directory

`trunk, assets, branches, tags`

Please note that the following directories have their particular purposes. With the banners and screenshots going into the assets folder, the different versions of our plugin goingto the tags folder and our current plugin being in the trunk. If our intended folder for deletion is in trunk say in a folder called delete-me We need the command

svn delete trunk/delete-me

This will cause a new change in the repo and if you svn stat the difference can be seen with the full changes made shown by the svn diff command.

All that is left is for you to now commit the changes. Simply:

 svn ci -m “message for the commit like deleted folder delete-me”

Mark you, sometimes this doesn’t complete to upload to the plugin repo if you are not logged into the repo. The login details are needed. You can provide these by retyping the above message and add your username and password such as

svn ci -m “remove bad folder” -- username --password

This will result into an update of your plugin repo. Please note that if your stable release version of the plugin is also in the tags folder, you need to update that folder too to ensure all works well.

Here is a video I recorded if you prefer video to reading a blog.

YouTube video showing the workflow of svn delete

Leave a Comment

Your email address will not be published.

You may like