How do I delete a branch?
To remove a branch from your repository, you can navigate to the Branches page and use the trash can icon on the far right. This can be done with merged and unmerged branches.
As well, use the following commands for your specific VCS (version control system) to delete your branch in that fashion.
git branch -d [branchname]
svn delete [branchname]
There are several options available for each command, so be sure to review the included links.
When should you delete a branch?
While it’s always possible to delete a branch, the two most common scenarios that make sense are:
- when the branch has been merged through your various environment branches and is into production (master or trunk)
- when the branch is no longer needed as the feature or planned work has been cancelled, or the branch was created by mistake