{"id":234,"date":"2012-07-10T21:50:16","date_gmt":"2012-07-11T01:50:16","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/acts\/?p=234"},"modified":"2012-07-10T23:15:06","modified_gmt":"2012-07-11T03:15:06","slug":"github-pull-request-for-just-one-commit","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/acts\/2012\/07\/10\/github-pull-request-for-just-one-commit\/","title":{"rendered":"Github Pull Request for Just One Commit"},"content":{"rendered":"<p>I have a <a href=\"https:\/\/github.com\/jazahn\/yii\">forked Yii<\/a> which I use as a submodule in a couple of my applications. I haven&#8217;t made many changes, but most would probably not be useful most people. i.e. I put <a href=\"https:\/\/github.com\/jazahn\/yii\/commit\/1604aa2cfce49de467b1f4b4b4be3c1055b5471c\">a conditional<\/a> in that checks the version of PHPUnit and if it&#8217;s older than 3.5 it uses a different include file. Thereby letting me get around the limitation I have in one of my development environments. <\/p>\n<p>My last commit, however, directly relates to <a href=\"https:\/\/github.com\/yiisoft\/yii\/issues\/315\">an issue Yii had identified<\/a>. So I wanted to push only that last commit upstream. <\/p>\n<p>First make sure you have the upstream remote.<br \/>\nThen fetch from upstream &#8212; this creates upstream\/master.<br \/>\nThen we create a new branch calling it upstream &#8212; not to be confused with the local remote we just created with the same name. <\/p>\n<p><code><br \/>\ncd yii<br \/>\ngit remote add upstream git:\/\/github.com\/yiisoft\/yii.git<br \/>\ngit fetch upstream<br \/>\ngit checkout -b upstream upstream\/master<br \/>\ngit cherry-pick <sha1><br \/>\ngit push origin upstream<br \/>\n<\/code><\/p>\n<p>Then use something that was new to me, cherry-pick and give it the hash of the specific commit.  That will merge over only that commit to the new branch you made.  Then just push it.<\/p>\n<p>From github, you can then make a Pull Request from that specific branch and contribute.  Since that&#8217;s what it&#8217;s all about.<\/p>\n<p>Helpful links:<br \/>\nhttps:\/\/help.github.com\/articles\/fork-a-repo<br \/>\nhttp:\/\/kurogo.org\/guide\/github.html<br \/>\nhttp:\/\/stackoverflow.com\/questions\/5256021\/send-a-pull-request-on-github-for-only-latest-commit<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a forked Yii which I use as a submodule in a couple of my applications. I haven&#8217;t made many changes, but most would probably not be useful most people. i.e. I put a conditional in that checks the version of PHPUnit and if it&#8217;s older than 3.5 it uses a different include file. [&hellip;]<\/p>\n","protected":false},"author":4571,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63924,3772,63928,63993,63937],"tags":[30752,64000,1029,63943],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-atg","category-git","category-quizmo-atg","category-version-control","category-yii","tag-fork","tag-github","tag-open-source","tag-yii-2"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/users\/4571"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/comments?post=234"}],"version-history":[{"count":6,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/234\/revisions"}],"predecessor-version":[{"id":239,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/234\/revisions\/239"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/media?parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/categories?post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/tags?post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}