views:

63

answers:

4

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 anymore?

A: 

Assuming this branch isnt an external or a symlink, removing the branch should be as simple as:

svn rm branches/< mybranch >

svn ci -m"whatever"

If youd like to do this in the repo then update to remove it from your working copy you can do something like:

svn rm http://&lt; myurl >/< myrepo >/branches/< mybranch >

then svn update

grmartin
+6  A: 

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.

Wim Coenen
A: 

You can delete the features folder just like any other in your checkout then commit the change.

To prevent this in the future I suggest you follow the naming conventions for SVN layout.

Either give each project a trunk, branches, tags folder when they are created.

svn
+ project1
  + trunk
    + src
    + etc...
  + branches
    + features
      + src
      + etc...
  + tags
+ project2
  + trunk
  + branches
  + tags
Chris Nava
+1  A: 

From the working copy:

svn rm branches/features
svn commit -m "delete stale feature branch"

sbi