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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

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