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.
Rename a branch
Section titled “Rename a branch”- Open your project.
- Click Repository Settings in the left activity bar.
- Select Branch Management.
- If the default branch is unknown, set the project default branch.
- In the branch’s row, click Rename.
- Enter the New branch name.
- Read and select the risk acknowledgment.
- Click Rename Branch.
- Confirm that the new name appears in the branch list.
Delete a branch
Section titled “Delete a branch”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.
- In Branch Management, find the branch you want to delete.
- Confirm that the branch contains no work you need to keep.
- In the branch’s row, click Delete.
- Review the branch name and the deletion warning.
- Type
Deletein the confirmation field. - Click Delete Branch.
- 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.