How do I delete a wrongly tagged directory in SVN?
I have a project Foo which I errantly created the wrong tag for. It should've read 'rMMDDYYYY' but I tagged it 'YYYYMMDD' instead. I realized my mistake after having commited my change. I now want to remove the YYYYMMDD folder under the tags directory and leave the rMMDDYYYY folder instead. i.e.
before: foo/ foo/trunk/ foo/branches/ foo/tags/ foo/tags/YYYYMMDD/ foo/tags/rMMDDYYYY
after: foo/ foo/trunk/ foo/branches/ foo/tags/ foo/tags/rMMDDYYYY
Any idea how I can do this please? Thanks in advance!
Solution 1:
If you want to remove the directory then use the svn rm
command:
svn rm foo/tags/YYYYMMDD
Solution 2:
svn delete http://example.com/svn/tags/tag-to-delete -m "Tag no longer needed"
is the best approach. See also here.
Solution 3:
Just delete the tag you dont want and create afresh with the same name or a different name. If you have tortoisesvn its as simple as deleting the directory from the repo browser. Then create a new tag.
Solution 4:
I'm assuming you can't just delete and re-add the directory (perhaps because the working copy has changed), or you would have done that. So you have at least two options:
- Check out the tagged revision, delete it from the repository, and re-add it in the desired location.
- Use the
svn mv
command: http://svnbook.red-bean.com/en/1.0/re18.html
Note that creating a tag in subversion doesn't actually copy the files; it just creates directory entries that point to the files (See “Cheap Copies”: http://svnbook.red-bean.com/en/1.0/ch04s02.html), so you needn't worry about bloating your repository.
The Subversion Book (http://svnbook.red-bean.com) is an incredibly clear and complete reference. If you haven't read it yet, you'll probably find it to be a wealth of information.
Good luck!