How to delete an old branch in EGit?

Imagine you worked on a feature on the branch e.g. remove-dead-code, pushed your change to Gerrit and now you want to delete your local branch remove-dead-code. You can't delete a checked out branch, so you need to switch to another branch and then delete the unwanted branch.

  1. Switch branch

    Right click on Saros and select Team → Switch To → branch (e.g. master)
    This should not be the branch you want to delete!

  2. Open delete dialog

    Right click on Saros and select Team → Advanced → Delete Branch...

  3. Select branch

    Select the branch you want to delete. The check mark indicates which branch is checked out.

  4. Confirmation

    Confirm the deletion by clicking OK