Delete a branch in TortoiseSVN

How do I delete a branch in TortoiseSVN?

  1. Can I simply delete the working copy of the branch and the folder in the repository?
  2. Should the local working copy of the branch first be deleted, or the branch folder through the Repository Browser be removed?

Solution 1:

Right click on any folder, select "Repo-browser" and find your branch on the left panel. From there, you can issue a "Delete" command directly on the repository:

Repository browser screenshot

As far as I know, you cannot issue a delete command on the top folder* of the working copy, probably because that would effectively destroy the working copy.

(*) You can of course remove the branch from the working copy if it's an inner folder, i.e., you check out e.g. https://svn.example.com/repo/project/branches instead of https://svn.example.com/repo/project/branches/feature-blah.

Solution 2:

The SVN book ("Version Control with Subversion") explains how to delete and restore branches.

Although it suggests remote deletion like

$ svn delete http://svn.example.com/repos/calc/branches/my-calc-branch \
  -m "Removing obsolete branch of calc project."

you could also do it locally (with the TortoiseSVN > Delete command).

As mentioned in the book, you can always restore branches, so you won't get any unexpected consequences.