Deleting an SVN branch

GSto picture GSto · Sep 28, 2010 · Viewed 134k times · Source

I created a branch of an SVN project called 'features', and now whenever I try to update said project, it brings with it a features folder, which contains another copy of the project from the branch. Is there a way to remove the branch from the repository completely so that this doesn't happen any more?

Answer

Wim Coenen picture Wim Coenen · Sep 28, 2010

Sure: svn rm the unwanted folder, and commit.

To avoid this situation in the future, I would follow the recommended layout for SVN projects:

  • Put your code in the /someproject/trunk folder (or just /trunk if you want to put only one project in the repository)
  • Created branches as /someproject/branches/somebranch
  • Put tags under /someproject/tags

Now when you check out a working copy, be sure to check out only trunk or some individual branch. Don't check everything out in one huge working copy containing all branches.1

1Unless you know what you're doing, in which case you know how to create shallow working copies.