Getting a list of project tags from Subversion

So there you are nicely tagging your project in Subversion, but for some reason you need to get a list of all the tags being used... That situation came up for me today. I thought it was going to be some really complex way of getting the tags, involving the use of hook scripts and the like. But it turns out that with some command line goodness it's actually much more simple. Here's how to do it:

CODE:
  1. svnlook tree --full-paths /home/path/to/svn/project | \
  2. egrep -a '/?tags/.+' | \
  3. sed -re 's!.*/?tags/([^/]*).*!\1!' | \
  4. sort -u

2 Responses to “Getting a list of project tags from Subversion”


  1. 1 cb

    Or: svn ls
    like: svn ls https://www.myserver.com/project/tags/

    Presuming that all the tags are created under the …tags/ folder as a matter of course.

  2. 2 Andy

    Much, much easier! Many thanks for the handy hint. :)

Leave a Reply

You must login to post a comment.