{"id":7370,"date":"2019-08-29T21:21:53","date_gmt":"2019-08-29T21:21:53","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=7370"},"modified":"2019-08-29T21:21:53","modified_gmt":"2019-08-29T21:21:53","slug":"renaming-a-git-branch","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/renaming-a-git-branch\/","title":{"rendered":"Renaming a git branch"},"content":{"rendered":"<p>Occasionally you need to rename a branch you&#8217;re working on in git. The following shows how to rename the branch and push commits (assuming the branch had already been pushed) to a remote location<\/p>\n<p><em>Note: if the branch has not been pushed to a remote location you only need to use the first two commands<\/em><\/p>\n<ul>\n<li>git checkout &lt;old_branch_name&gt;<\/li>\n<li>git branch -m &lt;new_branch_name&gt;<\/li>\n<li>git push origin &#8211;delete &lt;old_branch_name&gt;<\/li>\n<li>git push origin -u &lt;new_branch_name&gt;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Occasionally you need to rename a branch you&#8217;re working on in git. The following shows how to rename the branch and push commits (assuming the branch had already been pushed) to a remote location Note: if the branch has not been pushed to a remote location you only need to use the first two commands [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[206],"tags":[],"class_list":["post-7370","post","type-post","status-publish","format-standard","hentry","category-git-2"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/7370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=7370"}],"version-history":[{"count":3,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/7370\/revisions"}],"predecessor-version":[{"id":7382,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/7370\/revisions\/7382"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=7370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=7370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=7370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}