Rename remote branch without deleting it

Rename remote branch without deleting it

Quick oneliner for deleting old branch and creating a new one with same content is:

git push <remote> <remote>/<old>:refs/heads/<new> :<old>

where remote is obvious – e.g. origin, old and new are names of branches old and new respectively.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.