Delete a Local Branch

You can delete a local Git branch that you no longer need to keep your workspace free of clutter. Typically, after your work on a branch is done and you've pushed your changes to a remote repository, it's good housekeeping to delete your local branch.

If your work required you to create a merge request, you can delete the branch immediately following the merge. For all other scenarios, you can use the Delete Local Branch option in the Git menu.

If you delete a branch that hasn't been pushed, its unique commits are likely to be lost. Make sure you push any commits you want to keep.

To delete a local branch:

  1. Click the Git menu in the header and select Delete Local Branch.
  2. In the Delete Local Branch dialog, select the local branch you want to delete.

    A list of local branches that you can delete are shown. This list will not include your current working branch. If you want to delete the current working branch, you'll need to switch to another branch to make your original current working branch available for deletion.

  3. Select Yes, I want to delete the branch to confirm your action.
  4. Click Delete Branch.

    When the delete is successful, close the confirmation message that appears.