Is it possible to rename a remote branch on Bitbucket?
I found a command to do it locally git branch -m old-name new-name.
But not sure if this is the correct way and what will happen when I push it.
I'd like to update these answers a bit.
# if on the branch
git branch -m new-branch-name
# if on a different branch
git branch -m old-branch-name new-branch-name
# Delete the old branch on remote
git push origin --delete old-branch-name
# Push the new branch to remote
git push origin new-branch-name
# Reset the upstream branch
git push origin -u new-branch-name
git fetch --all
git checkout new-branch-name
This worked well for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With