How to change branch name in Azure DevOps

GitAzure DevopsBranch

Git Problem Overview


Is there a way to change branch name in Azure DevOps. As shown in SS i have named my branch as Developer branch, now i want to change it to a specific request-id. Is this possible.

branches

Git Solutions


Solution 1 - Git

Unfortunately, you are not able to rename a branch. However, you can create a new branch from the branch which you want to rename then you can delete that branch.

As per the design, the rename of azure repo branches is not implemented. You can see this existing similar thread

Microsoft's documentation page "Rename old branches" gives the following instructions:

  1. open repo > Branches view.
  2. locate the old branch.
  3. hover over the old branch > ...(More) icon > + New Branch.
  4. enter the new branch name > Create branch.
  5. hover over the old branch > trash icon (Delete branch).

Solution 2 - Git

You can do this by following these steps:

  • Rename the branch using git from X to Y
  • In Azure:
  • Delete the linked branch (X)
  • Add a link to your new branch (Y)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSalmanView Question on Stackoverflow
Solution 1 - GitJayendranView Answer on Stackoverflow
Solution 2 - GitLiran HView Answer on Stackoverflow