Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting an SVN branch

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?

like image 327
GSto Avatar asked Sep 28 '10 20:09

GSto


People also ask

How do I delete a branch in TortoiseSVN?

To delete the branch after you're finished with it, the simplest thing to do is choose TortoiseSVN->Repo Browser. From there, assuming you did this from your branch, it should already be highlighted. In any event, navigate to your branch in the treeview on the left, and then right-click and select Delete.

Can I rename a branch in svn?

Because branches and tags are ordinary directories, the svn move command can move or rename them however you wish.

Does deleting a branch delete sub branches?

Mikkel Rasmussen. It would not delete the bar_feature branch. From the article: If the branch was merged into another branch before it was deleted then all of the commits will still be reachable from the other branch when the first branch is deleted. They remain exactly as they were.


1 Answers

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.

like image 96
Wim Coenen Avatar answered Oct 08 '22 08:10

Wim Coenen