6

we have a branch on remote called release/service-release-2016

I want to rename the branch to release/completed/service-release-2016 for archiving and clarity.

How do I do this?

Everything I searched for interpreted this as moving around commits and the head, etc. - I'm thinking this is probably pretty easy.

Oliver Williams
  • 5,966
  • 7
  • 36
  • 78
  • 1
    Simply run `git branch -m release/service-release-2016 release/completed/service-release-2016`. – jub0bs Jun 29 '16 at 20:31

1 Answers1

3

One way to do this would be to check out the remote branch to a temporary branch name locally, push to the new name on the remote, and then delete the remote branch. For example:

git checkout -b tmp origin/release/service-release-2016

Create the new remote branch:

git push origin tmp:release/completed/service-release-2016

Delete the old remote branch:

git push origin :release/service-release-2016
jholtrop
  • 406
  • 4
  • 6