{"id":86990,"date":"2025-06-27T06:09:00","date_gmt":"2025-06-27T10:09:00","guid":{"rendered":"https:\/\/bugaluu.com\/sapiosexual\/git-how-to-rename-a-branch-both-local-and-remote\/"},"modified":"2025-06-27T06:09:00","modified_gmt":"2025-06-27T10:09:00","slug":"git-how-to-rename-a-branch-both-local-and-remote","status":"publish","type":"post","link":"https:\/\/bugaluu.com\/sapiosexual\/git-how-to-rename-a-branch-both-local-and-remote\/","title":{"rendered":"git: how to rename a branch (both local and remote)?"},"content":{"rendered":"<p>I have a local branch master that points to a remote branch origin\/regacy (oops, typo!). How do I rename the remote branch to origin\/legacy or origin\/master? I tried: git remote rename regacy legac&#8230;<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/30590083\/git-how-to-rename-a-branch-both-local-and-remote\" target=\"_blank\" class=\"\">https:\/\/stackoverflow.com\/questions\/30590083\/git-how-to-rename-a-branch-both-local-and-remote<\/a>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a local branch master that points to a remote branch origin\/regacy (oops, typo!). How do I rename the remote branch to origin\/legacy or&#8230;<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-86990","post","type-post","status-publish","format-standard","hentry","category-sapiosexual","wpcat-1-id"],"_links":{"self":[{"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/posts\/86990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/comments?post=86990"}],"version-history":[{"count":0,"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/posts\/86990\/revisions"}],"wp:attachment":[{"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/media?parent=86990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/categories?post=86990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bugaluu.com\/sapiosexual\/wp-json\/wp\/v2\/tags?post=86990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}