{"id":1022,"date":"2018-02-16T10:56:45","date_gmt":"2018-02-16T10:56:45","guid":{"rendered":"http:\/\/www.max-sperling.bplaced.net\/?p=1022"},"modified":"2024-02-16T10:43:24","modified_gmt":"2024-02-16T10:43:24","slug":"rebase-branch-on-rebased-parent-git","status":"publish","type":"post","link":"http:\/\/www.max-sperling.bplaced.net\/?p=1022","title":{"rendered":"Rebase branch on rebased parent (Git)"},"content":{"rendered":"<p>This is necessary when you develop on an child-feature-branch and the parent-feature-branch has been rebased.<\/p>\n<p><strong>0. Initial situation<\/strong><\/p>\n<pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\r\n                3f5a---74ed [child_feature]\r\n                 \/\r\n        c1b0---62d8 [parent_feature]\r\n         \/\r\ne73a---6cfa---90ed [develop]\r\n<\/pre>\n<hr>\n<p><strong>1. Rebase parent<\/strong><\/p>\n<pre>$ git rebase develop parent_feature<\/pre>\n<pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\r\n                3f5a---74ed [child_feature]\r\n                 \/\r\n        c1b0---62d8 [parent_feature]\r\n         \/\r\ne73a---6cfa---90ed [develop]\r\n                \\\r\n               8cc3---729e [parent_feature] (rebased)\r\n<\/pre>\n<hr>\n<p><strong>2. Rebase child<\/strong><\/p>\n<p><u>Bad Solution:<\/u> &#8211;> Normal rebase<\/p>\n<pre>$ git rebase parent_feature child_feature<\/pre>\n<p>You have to solve the same merge-conflicts again. \ud83d\ude41<\/p>\n<p><u>Good Solution:<\/u> &#8211;> Rebase onto<\/p>\n<pre>$ git rebase --onto parent_feature parent_feature@{1} child_feature<\/pre>\n<p>Alternative:<\/p>\n<pre>$ git rebase --onto 729e 62d8 child_feature<\/pre>\n<pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\r\ne73a---6cfa---90ed [develop]\r\n                \\\r\n               8cc3---729e [parent_feature] (rebased)\r\n                       \\\r\n                       27ba---ff23 [child_feature] (rebased)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is necessary when you develop on an child-feature-branch and the parent-feature-branch has been rebased. 0. Initial situation 1. Rebase<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false},"categories":[24],"tags":[],"_links":{"self":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/1022"}],"collection":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1022"}],"version-history":[{"count":1,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/1022\/revisions"}],"predecessor-version":[{"id":16821,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/1022\/revisions\/16821"}],"wp:attachment":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1022"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}