{"id":12696,"date":"2021-11-16T13:17:53","date_gmt":"2021-11-16T13:17:53","guid":{"rendered":"http:\/\/www.max-sperling.bplaced.net\/?p=12696"},"modified":"2024-02-16T10:41:24","modified_gmt":"2024-02-16T10:41:24","slug":"apply-patches-to-updates-git","status":"publish","type":"post","link":"http:\/\/www.max-sperling.bplaced.net\/?p=12696","title":{"rendered":"Reapply patches to updates (Git)"},"content":{"rendered":"<p>Let&#8217;s asume you have a repo containing an external SW. (forked repo or specific version)<\/p>\n<pre>\r\n   Branches   |   Commits\r\n--------------|---------------\r\n    master    | last_for_v1.0\r\n              |  (Tag: v1.0)\r\n<\/pre>\n<p>For a proper usage in your project you possibly have to implement\/apply some patches.<\/p>\n<pre>\r\n   Branches   |   Commits\r\n--------------|---------------------------\r\n    master    | last_for_v1.0\r\n              |  (Tag: v1.0)\r\n              |       \u2193\r\n v1.0_patched |    patch_1 --> patch_2\r\n              |              (Tag: v1.0p)\r\n<\/pre>\n<p>After updating to a newer version you most likely have to apply your patches again.<\/p>\n<pre>\r\n   Branches   |   Commits\r\n--------------|------------------------------------------------\r\n    master    | last_for_v1.0 -..->  last_for_v2.0\r\n              |  (Tag: v1.0)          (Tag: v2.0)\r\n              |       \u2193                    |\r\n v1.0_patched |    patch_1 --> patch_2     |\r\n              |              (Tag: v1.0p)  |\r\n              |                            \u2193\r\n v2.0_patched |                         patch_1 --> patch_2\r\n              |                                   (Tag: v2.0p)\r\n<\/pre>\n<pre>\r\n$ git checkout v2.0\r\n$ git checkout -b v2.0_patched\r\n$ git cherry-pick $(git merge-base master v1.0_patched)..v1.0_patched\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s asume you have a repo containing an external SW. (forked repo or specific version) Branches | Commits &#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;&#8212;&#8212;&#8212;&#8212; master<\/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\/12696"}],"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=12696"}],"version-history":[{"count":1,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/12696\/revisions"}],"predecessor-version":[{"id":16810,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/12696\/revisions\/16810"}],"wp:attachment":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12696"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}