Skip to content

Manage branches

Before you rename or delete a shared branch, coordinate with teammates who use it. These actions can also change the corresponding remote branch.

  1. Open your project.
  2. Click Repository Settings in the left activity bar.
  3. Select Branch Management.
  4. If the default branch is unknown, set the project default branch.
  5. In the branch’s row, click Rename.
  6. Enter the New branch name.
  7. Read and select the risk acknowledgment.
  8. Click Rename Branch.
  9. Confirm that the new name appears in the branch list.

Deletion removes the selected branch locally and on the remote if it is tracked. Preserve any work you still need before you delete the branch.

  1. In Branch Management, find the branch you want to delete.
  2. Confirm that the branch contains no work you need to keep.
  3. In the branch’s row, click Delete.
  4. Review the branch name and the deletion warning.
  5. Type Delete in the confirmation field.
  6. Click Delete Branch.
  7. Confirm that the branch no longer appears in the list.

If deletion is disabled, check default-branch protection. To delete your current branch, first switch to another branch from Home.

An Inactive badge identifies a branch whose last recorded update is more than two weeks old. The badge does not prove the branch is safe to delete.