SysTutorials Forums QA How to rename a branch name in the remote git server?

Tagged: 

How to rename a branch name in the remote git server? For example, I made a mistake to push a branch named ood-name to the git server while I intended to name it old-name.

How to rename the branch name ood-name on the remote git server?

You may change the remote git server’s branch name as follows.

$ git checkout ood-name # check out the branch
$ git branch -m old-name # change local branch name
# push local old-name to remote ood-name and change the remote branch name
$ git push origin :ood-name old-name

If everything went well, the remote branch should have been changed accordingly.

Reply To: How to rename a branch name in the remote git server?
Your information:





<a href="" title="" rel="" target=""> <blockquote cite=""> <code> <pre> <em> <strong> <del datetime=""> <ul> <ol start=""> <li> <img src="" border="" alt="" height="" width="">

Please share if you like this post: