{"id":1586,"date":"2018-06-24T17:32:19","date_gmt":"2018-06-24T18:02:19","guid":{"rendered":"https:\/\/ultering.com\/it4us\/?p=1586"},"modified":"2020-08-30T16:21:09","modified_gmt":"2020-08-30T16:51:09","slug":"git-merge-alternatives-for-many-conflicts","status":"publish","type":"post","link":"https:\/\/ultering.com\/it4us\/?p=1586","title":{"rendered":"GIT: MERGE ALTERNATIVES FOR MANY CONFLICTS"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a04cf7a328e3\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a04cf7a328e3\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ultering.com\/it4us\/?p=1586\/#PRE-REQUISITES\" title=\"#PRE-REQUISITES\">#PRE-REQUISITES<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ultering.com\/it4us\/?p=1586\/#ALTERNATIVE1\" title=\"ALTERNATIVE#1\">ALTERNATIVE#1<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ultering.com\/it4us\/?p=1586\/#ALTERNATIVE2\" title=\"ALTERNATIVE#2\">ALTERNATIVE#2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ultering.com\/it4us\/?p=1586\/#ALTERNATIVE3\" title=\"ALTERNATIVE#3\">ALTERNATIVE#3<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"PRE-REQUISITES\"><\/span>#PRE-REQUISITES<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Make sure that your local repository is committed or stashed.<br \/>\nIf not, Git will complain, since it is basic versioning procedure.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"ALTERNATIVE1\"><\/span>ALTERNATIVE#1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Suppose that your current branch is &#8220;feature\/branch1&#8221;.<br \/>\nDo:<br \/>\ngit commit -am &#8220;before merging&#8221;<br \/>\nor if already committed you may mark this operation using:<br \/>\ngit commit &#8211;allow-empty -am&#8221;before merging operation with develop branch&#8221;<\/p>\n<p>git checkout develop<br \/>\ngit pull develop<\/p>\n<p>&#8211; create a new merging local branch:<br \/>\ngit checkout -b feature\/branch1_merge<\/p>\n<p>&#8211; testing, just in case:<br \/>\ngit merge\u00a0feature\/branch1<\/p>\n<p>Merge your conflicts without messing the working branch.<br \/>\nIf something goes wrong, you may delete the local branch, and restart the operation faster and without any setback, since the working directory is fully untouched.<\/p>\n<p>git branch -d feature\/branch1_merge<\/p>\n<p>Run the application to test the operation.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"ALTERNATIVE2\"><\/span>ALTERNATIVE#2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Overwrites all local files, and the merge is performed just over your working files.<\/p>\n<p>Suppose that your current branch is &#8220;feature\/branch1&#8221;.<br \/>\nDo:<br \/>\ngit commit -am &#8220;before merging&#8221;<br \/>\nor if already committed you may mark this operation using:<br \/>\ngit commit &#8211;allow-empty -am&#8221;before merging operation with develop branch&#8221;<\/p>\n<p>git checkout develop<br \/>\ngit pull develop<\/p>\n<p>&#8211; create a new merging local branch:<br \/>\ngit checkout -b feature\/branch1_merge<\/p>\n<p>&#8211; testing, just in case:<br \/>\ngit merge -X theirs feature\/branch1<\/p>\n<p>Merge your working files using the source from &#8220;feature\/branch1&#8221;.<br \/>\nIf something goes wrong, you may delete the local branch, and restart the operation faster and without any setback, since the working directory is fully untouched.<\/p>\n<p>git branch -d feature\/branch1_merge<\/p>\n<p>Run the application to test the operation.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"ALTERNATIVE3\"><\/span>ALTERNATIVE#3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>It is not recommended, unless in critical cases when lacking time is an issue.<\/p>\n<p>Get a list of your working files (those you want to merge).<br \/>\nPerform a merge operation file by file straight into the target, in this example, you use the source from &#8220;feature\/branch1&#8221; and the respective target from &#8220;develop&#8221;.<\/p>\n<p>&nbsp;<\/p>\n<h2><\/h2>\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>#PRE-REQUISITES Make sure that your local repository is committed or stashed. If not, Git will complain, since it is basic versioning procedure. ALTERNATIVE#1 Suppose that your current branch is &#8220;feature\/branch1&#8221;. Do: git commit -am &#8220;before merging&#8221; or if already committed you may mark this operation using: git commit &#8211;allow-empty -am&#8221;before merging operation with develop branch&#8221; &#8230; <a href=\"https:\/\/ultering.com\/it4us\/?p=1586\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &#8220;GIT: MERGE ALTERNATIVES FOR MANY CONFLICTS&#8221;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[35],"tags":[],"class_list":["post-1586","post","type-post","status-publish","format-standard","hentry","category-versioning"],"_links":{"self":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/1586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1586"}],"version-history":[{"count":3,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/1586\/revisions"}],"predecessor-version":[{"id":4167,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/1586\/revisions\/4167"}],"wp:attachment":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}