The wrong Jira Key is in the branch name and now it is linked to the wrong Jira. The branch has already been merged into main. Is there a way to rename that branch so that the Jira is referring to the correct branch?
Hi Jamie,
Yes, this is possible.
Assuming that the branch is named TEST-16-branch and you want to rename it to TEST-17-branch, you can do the following:
1. Clone the Bitbucket repository
2. Navigate to the directory of the clone, and checkout TEST-16-branch with the command:
git checkout TEST-16-branch
3. Rename the branch with the command:
git branch -m TEST-17-branch
4. Push the renamed branch to the Bitbucket repo:
git push origin TEST-17-branch
5. Delete the remote branch TEST-16-branch:
git push origin --delete TEST-16-branch
The renamed branch TEST-17-branch should now be referenced in the Jira issue TEST-17, and the deleted branch TEST-16-branch should no longer be referenced in the Jira issue TEST-16.
Please feel free to let me know how it goes and if you have any questions!
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.