How do I delete a wrongly tagged directory in SVN?

SvnTags

Svn Problem Overview


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!

Svn Solutions


Solution 1 - Svn

If you want to remove the directory then use the svn rm command:

svn rm foo/tags/YYYYMMDD

Solution 2 - Svn

svn delete http://example.com/svn/tags/tag-to-delete -m "Tag no longer needed"

is the best approach. See also here.

Solution 3 - Svn

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 - Svn

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:

  1. Check out the tagged revision, delete it from the repository, and re-add it in the desired location.
  2. 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!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionfreakwincyView Question on Stackoverflow
Solution 1 - SvnErik SchierboomView Answer on Stackoverflow
Solution 2 - SvnEddieView Answer on Stackoverflow
Solution 3 - SvnshikharView Answer on Stackoverflow
Solution 4 - SvnAdam LissView Answer on Stackoverflow