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.

1
  • 1
    Simply run git branch -m release/service-release-2016 release/completed/service-release-2016. Commented Jun 29, 2016 at 20:31

1 Answer 1

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 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.