{"id":1221,"date":"2009-01-12T01:30:55","date_gmt":"2009-01-11T23:30:55","guid":{"rendered":"http:\/\/vizZzion.org\/blog\/2009\/01\/merging-branches-upstream-with-git\/"},"modified":"2009-01-12T01:30:55","modified_gmt":"2009-01-11T23:30:55","slug":"merging-branches-upstream-with-git","status":"publish","type":"post","link":"https:\/\/vizZzion.org\/blog\/2009\/01\/merging-branches-upstream-with-git\/","title":{"rendered":"Merging branches upstream with Git."},"content":{"rendered":"<p>This is one of those &#8220;<em>I write it on my blog so I can easily find it<br \/>\n    back<\/em>&#8221;<br \/>\n        posts, that&#8217;s hopefully useful to someone out there.<br \/> For KDE development, I&#8217;m using git and git-svn to manage the codebase. Earlier today, I&#8217;ve merged a branch I had created over new year&#8217;s holiday. It consisted of 25 patches, some larger (implementing a new feature), some smaller, cleanups, but also some patches I wanted to keep separate for easier reference and review. I didn&#8217;t want to commit it to KDE&#8217;s SVN as one huge commit, but also not as 25, with a lot of those smaller ones that were more the &#8220;savegame&#8221; type of commit you do once in a while to easily get back to a &#8220;working state&#8221; when you&#8217;re about to break things or experiment.<br \/> Git&#8217;s rebase tool is what I wanted then. I&#8217;ve started off with my branch, counted it was 25 commits I want to restructure.<\/p>\n<pre>git rebase --interactive HEAD~25<\/pre>\n<p>        Gives you a list you can pick commits from. Every commit is shown on one    line, starting with the keyword &#8220;pick&#8221;. For commits you want to keep as-is, leave that line alone. Make it &#8220;squash&#8221; to combine this commit with the one on the previous line. Write &#8220;edit&#8221; to tweak the commit message. Just remove the commits you don&#8217;t want. Git will instruct you to do what&#8217;s needed, changing a log message, possibly solving a conflict. You pick up the rebasing process with<\/p>\n<pre>git rebase --continue<\/pre>\n<p>        then. If you&#8217;re done, you can merge your branch, for example using &#8220;git svn dcommit&#8221; (do check with &#8220;git log&#8221;, &#8220;git show&#8221; and &#8220;git svn dcommit -n&#8221; first if everything worked OK).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is one of those &#8220;I write it on my blog so I can easily find it back&#8221; posts, that&#8217;s hopefully useful to someone out there. For KDE development, I&#8217;m using git and git-svn to manage the codebase. Earlier today, I&#8217;ve merged a branch I had created over new year&#8217;s holiday. It consisted of 25&hellip; <a class=\"more-link\" href=\"https:\/\/vizZzion.org\/blog\/2009\/01\/merging-branches-upstream-with-git\/\">Continue reading <span class=\"screen-reader-text\">Merging branches upstream with Git.<\/span> <span class=\"meta-nav\" aria-hidden=\"true\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1221","post","type-post","status-publish","format-standard","hentry","category-kde"],"_links":{"self":[{"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/posts\/1221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/comments?post=1221"}],"version-history":[{"count":0,"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/posts\/1221\/revisions"}],"wp:attachment":[{"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/media?parent=1221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/categories?post=1221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vizZzion.org\/blog\/wp-json\/wp\/v2\/tags?post=1221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}