{"id":951,"date":"2020-05-07T23:07:32","date_gmt":"2020-05-07T23:07:32","guid":{"rendered":"https:\/\/kalkus.dev\/?p=951"},"modified":"2023-08-24T23:32:20","modified_gmt":"2023-08-24T23:32:20","slug":"how-to-update-feature-branch-from-master-in-git","status":"publish","type":"post","link":"https:\/\/kalkus.dev\/blog\/2020\/05\/07\/how-to-update-feature-branch-from-master-in-git\/","title":{"rendered":"How to update feature branch from master in Git"},"content":{"rendered":"\n<p>If you want to update your git feature branch with the new changes from the master branch, you need to:<\/p>\n\n\n\n<ol type=\"1\"><li>Update master branch<\/li><li>Merge or rebase the new changes<\/li><\/ol>\n\n\n\n<p>TL;DR: merging creates additional commit, rebasing rewrites history. Usually the team chooses the way to handle conflicts in repository so ask your colleagues first what your team approach is.<\/p>\n\n\n\n<h4>To merge<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git checkout master\ngit pull\ngit checkout target_feature_branch\ngit merge master<\/pre>\n\n\n\n<h4>To rebase<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git pull --rebase origin target_feature_branch \nfix conflict and then \u2192 git add . \ngit rebase --continue \ngit push -f<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to update your git feature branch with the new changes from the master branch, you need to: Update master branch Merge or rebase the new changes TL;DR: merging creates additional commit, rebasing rewrites history. Usually the team chooses the way to handle conflicts in repository so ask your colleagues first what your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":957,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[202,76],"tags":[141,140,143],"_links":{"self":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts\/951"}],"collection":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/comments?post=951"}],"version-history":[{"count":2,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts\/951\/revisions"}],"predecessor-version":[{"id":961,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts\/951\/revisions\/961"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/media\/957"}],"wp:attachment":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/media?parent=951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/categories?post=951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/tags?post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}