{"id":361,"date":"2016-08-28T22:28:49","date_gmt":"2016-08-29T02:28:49","guid":{"rendered":"https:\/\/www.ccrossan.com\/?p=361"},"modified":"2016-08-28T22:28:49","modified_gmt":"2016-08-29T02:28:49","slug":"git-rebase","status":"publish","type":"post","link":"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/","title":{"rendered":"Git Rebase"},"content":{"rendered":"\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=crossan007\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n<p>So, You&#8217;ve developed this great new feature and you&#8217;re ready to submit the code for inclusion into the project. You hit &#8220;pull request,&#8221; and patiently wait for feedback.<\/p>\n<p>Then it happens.<\/p>\n<p>Someone says &#8220;Can you merge this into [insert parent branch name here&#8217;]. You get a sinking feeling in your stomach, and say &#8220;oh no! now I have to make all of my changes over again from\u00a0<em>that<\/em> branch.<\/p>\n<p>Never fear, this is what rebasing is for!<\/p>\n<p>In this case, you need to tell git to take the commits you&#8217;ve added, and play them back against a different branch. \u00a0The process goes something like this:<\/p>\n<pre><\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"> git rebase --onto master myNewFeatureBranch~1 myNewFeatureBranch<\/pre>\n<p>If all goes well, you&#8217;ll end up in the same branch, all of your changes will be intact, and the result of (diff to master) will be\u00a0<em>only your changes!!!<\/em><\/p>\n<p>Also Collapse commits:\u00a0http:\/\/stackoverflow.com\/questions\/6884022\/collapsing-a-group-of-commits-into-one-on-git<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, You&#8217;ve developed this great new feature and you&#8217;re ready to submit the code for inclusion into the project. You hit &#8220;pull request,&#8221; and patiently wait for feedback. Then it happens. Someone says &#8220;Can you merge this into [insert parent branch name here&#8217;]. You get a sinking feeling in your stomach, and say &#8220;oh no! &hellip; <a href=\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Git Rebase<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[156],"tags":[161,157,159,160,158],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Rebase - Charles&#039; Blog\" \/>\n<meta property=\"og:description\" content=\"So, You&#8217;ve developed this great new feature and you&#8217;re ready to submit the code for inclusion into the project. You hit &#8220;pull request,&#8221; and patiently wait for feedback. Then it happens. Someone says &#8220;Can you merge this into [insert parent branch name here&#8217;]. You get a sinking feeling in your stomach, and say &#8220;oh no! &hellip; Continue reading Git Rebase &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/\" \/>\n<meta property=\"og:site_name\" content=\"Charles&#039; Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-29T02:28:49+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"crossan007\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\",\"url\":\"https:\/\/crossan007.dev\/blog\/\",\"name\":\"Charles&#039; Blog\",\"description\":\"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crossan007.dev\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/#webpage\",\"url\":\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/\",\"name\":\"Git Rebase - Charles&#039; Blog\",\"isPartOf\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\"},\"datePublished\":\"2016-08-29T02:28:49+00:00\",\"dateModified\":\"2016-08-29T02:28:49+00:00\",\"author\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\"},\"breadcrumb\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crossan007.dev\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git Rebase\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\",\"name\":\"crossan007\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"caption\":\"crossan007\"},\"url\":\"https:\/\/crossan007.dev\/blog\/author\/crossan007\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/","og_locale":"en_US","og_type":"article","og_title":"Git Rebase - Charles&#039; Blog","og_description":"So, You&#8217;ve developed this great new feature and you&#8217;re ready to submit the code for inclusion into the project. You hit &#8220;pull request,&#8221; and patiently wait for feedback. Then it happens. Someone says &#8220;Can you merge this into [insert parent branch name here&#8217;]. You get a sinking feeling in your stomach, and say &#8220;oh no! &hellip; Continue reading Git Rebase &rarr;","og_url":"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/","og_site_name":"Charles&#039; Blog","article_published_time":"2016-08-29T02:28:49+00:00","twitter_misc":{"Written by":"crossan007","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/crossan007.dev\/blog\/#website","url":"https:\/\/crossan007.dev\/blog\/","name":"Charles&#039; Blog","description":"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crossan007.dev\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/#webpage","url":"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/","name":"Git Rebase - Charles&#039; Blog","isPartOf":{"@id":"https:\/\/crossan007.dev\/blog\/#website"},"datePublished":"2016-08-29T02:28:49+00:00","dateModified":"2016-08-29T02:28:49+00:00","author":{"@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979"},"breadcrumb":{"@id":"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crossan007.dev\/blog\/vcs\/git-rebase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crossan007.dev\/blog\/"},{"@type":"ListItem","position":2,"name":"Git Rebase"}]},{"@type":"Person","@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979","name":"crossan007","image":{"@type":"ImageObject","@id":"https:\/\/crossan007.dev\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","caption":"crossan007"},"url":"https:\/\/crossan007.dev\/blog\/author\/crossan007\/"}]}},"_links":{"self":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/361"}],"collection":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":5,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions\/387"}],"wp:attachment":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}