Should I delete a branch after merging it?
It is safe to delete a branch after merging it.
Since it is recommended to keep your Pull Requests smaller and more frequent, you may want to delete your branch after merging it in order to use the branch name again. You may also want to delete a branch to help keep your repository history organized. The best way to delete your branch after merging is in the desktop app. While on the branch you would like to delete, select Branch > Delete. To delete the branch both locally and on the remote, you will want to be sure to select the checkbox stating Yes, delete this branch on the remote.
Another way to delete the branch on the remote is once the Pull Request is merged. You will be given the opportunity to delete the branch by clicking the Delete Branch button. This is an optional step that will only delete the branch in the remote repository -- the local branch will remain unless it is deleted locally.
However, it is not always necessary to delete branches. You may want to keep branches after being merged to help with tracking or auditing purposes.
Elements of the UI may have changed since the time of posting. For the most up-to-date information, refer to our Documentation.