in WordPress

How to Replace a Tag in Subversion

I am typically doing this to make a readme.txt update to a WordPress plugin without forcing an update upon all the users for something trivial like updating the “Tested Up to” header. However, I always forget the correct steps for doing this. I am mostly writing this to store it here for the next time I forget.

Ensure you have a local working copy.

svn co <SVN REPO URL>

Edit the files in trunk:

vim trunk/readme.txt

Remove the tag you plan to replace, then re-copy trunk to that tag:

svn rm tags/<tag to replace>
svn cp trunk tags/<tag to replace>

You could also just copy the specific files over after deleting them instead of replacing the entire tag:

svn rm tags/<tag to replace>/readme.txt
svn cp trunk/readme.txt tags/readme.txt

Then commit your changes and you’re on your way.

This really isn’t what Subversion tags were meant to be used for, but it’s the system we have for releasing plugins. Tags should represent your repo at a state in time, and once created, shouldn’t be modified. While I could release a new version for these minor updates, it seems like an unnecessary burden on users. So this is what I’ll continue to do until we have a better option. Like an admin interface for updating plugin headers…

Write a Comment

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)

  1. Hi Josh. You need to first svn commit the locally modified file and then do an svn cp of the updated file to the tag version of the file, right?