{"id":2048,"date":"2018-01-22T16:03:40","date_gmt":"2018-01-22T21:03:40","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=2048"},"modified":"2018-01-22T16:03:40","modified_gmt":"2018-01-22T21:03:40","slug":"git-pull-requests","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=2048","title":{"rendered":"Git Pull Requests"},"content":{"rendered":"<p class=\"MsoNormal\">I have finally run through the process of submitting a pull request to suggest changes to a Git repository. Do the normal &#8216;stuff&#8217; either to make a new project or to clone an existing project to your computer. Create a new branch and check out that branch.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">C:\\ljr\\git&gt;<b>git clone https:\/\/github.com\/ljr55555\/SampleProject<\/b><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Cloning into &#8216;SampleProject&#8217;&#8230;<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">remote: Counting objects: 4, done.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">remote: Compressing objects: 100% (3\/3), done.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Unpacking objects: 100% (4\/4), done.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">C:\\ljr\\git&gt;cd SampleProject<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">C:\\ljr\\git\\SampleProject&gt;<b>git branch newEdits<\/b><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">C:\\ljr\\git\\SampleProject&gt;<b>git checkout newEdits<\/b><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Switched to branch &#8216;newEdits&#8217;<\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt;\">Make some changes and commit them to your branch<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">C:\\ljr\\git\\SampleProject&gt;<b>git add helloworld.pl<\/b><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">C:\\ljr\\git\\SampleProject&gt;<b>git commit -m &#8220;Added hello world script&#8221;<\/b><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">C:\\ljr\\git\\SampleProject&gt;<b>git push origin newEdits<\/b><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Counting objects: 3, done.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Delta compression using up to 4 threads.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Compressing objects: 100% (3\/3), done.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Writing objects: 100% (3\/3), 408 bytes | 408.00 KiB\/s, done.<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">Total 3 (delta 0), reused 0 (delta 0)<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">To https:\/\/github.com\/ljr55555\/SampleProject<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in .0001pt .5in;\">\u00a0* [new branch]\u00a0\u00a0\u00a0\u00a0\u00a0 newEdits -&gt; newEdits<\/p>\n<p class=\"MsoNormal\">On the GitHub site, click the \u201cnew pull request\u201d button. Since you select the two branches within the pull request, it doesn\u2019t seem to matter which branch\u2019s \u201cPull request\u201d tab you select.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2049\" rel=\"attachment wp-att-2049\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2049\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest01-1024x416.png\" alt=\"\" width=\"960\" height=\"390\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest01-1024x416.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest01-300x122.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest01-768x312.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest01.png 1308w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">Select the source branch and the one with your changes. Verify you can merge the branches (otherwise you\u2019ve got a problem and need to resolve conflicts). Review the changes, then click \u201cCreate pull request\u201d<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2050\" rel=\"attachment wp-att-2050\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2050\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest02-1024x623.png\" alt=\"\" width=\"960\" height=\"584\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest02-1024x623.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest02-300x183.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest02-768x467.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest02.png 1315w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">Here\u2019s another place for comments \u2013 comments on the pull request, not the commit comments. Click \u201cCreate pull request\u201d.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2051\" rel=\"attachment wp-att-2051\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2051\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest03-1024x764.png\" alt=\"\" width=\"960\" height=\"716\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest03-1024x764.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest03-300x224.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest03-768x573.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest03.png 1235w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">Click \u201cCreate pull request\u201d and you\u2019ve got one! Now what do we do with it (i.e. if you\u2019re the repository owner and <i>receive<\/i> a pull request). If you check the \u201cPull request\u201d tab on your project, you should see one now.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2052\" rel=\"attachment wp-att-2052\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2052\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest04-1024x424.png\" alt=\"\" width=\"960\" height=\"398\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest04-1024x424.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest04-300x124.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest04-768x318.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest04.png 1272w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">Click on it to explore the changes that have been made \u2013 the \u201cCommits\u201d tab will have the commits, and the \u201cFiles changed\u201d tab will show you the specific changes that have been made.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2053\" rel=\"attachment wp-att-2053\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2053\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest05-1024x594.png\" alt=\"\" width=\"960\" height=\"557\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest05-1024x594.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest05-300x174.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest05-768x446.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest05.png 1263w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">You could just comment and close the pull request (if, for instance, there was a <i>reason<\/i> you had not implemented the project that way and do not wish to incorporate the changes into your master branch). Assuming you <i>do<\/i> wish to incorporate the code, there are a couple of ways you can merge the new code into your base branch. The default is generally a good, or read the doc at <a href=\"https:\/\/help.github.com\/articles\/about-pull-request-merges\/\">https:\/\/help.github.com\/articles\/about-pull-request-merges\/<\/a><\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2054\" rel=\"attachment wp-att-2054\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2054\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest06.png\" alt=\"\" width=\"824\" height=\"501\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest06.png 824w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest06-300x182.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest06-768x467.png 768w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">Select the appropriate merge type and click the big green button. You have an opportunity to edit the commit message at this point, or just click \u201cConfirm merge\u201d<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2055\" rel=\"attachment wp-att-2055\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2055\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest07.png\" alt=\"\" width=\"986\" height=\"297\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest07.png 986w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest07-300x90.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest07-768x231.png 768w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">Voila, it is merged in. You can write some comment to close out the pull request.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2056\" rel=\"attachment wp-att-2056\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2056\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest08.png\" alt=\"\" width=\"989\" height=\"746\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest08.png 989w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest08-300x226.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest08-768x579.png 768w\" sizes=\"auto, (max-width: 989px) 100vw, 989px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">There is a notification that the request was completed and the branch can be deleted.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2057\" rel=\"attachment wp-att-2057\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2057\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest09.png\" alt=\"\" width=\"996\" height=\"607\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest09.png 996w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest09-300x183.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest09-768x468.png 768w\" sizes=\"auto, (max-width: 996px) 100vw, 996px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">And the project no longer has any open pull requests (you can remove the \u201cis open\u201d filter and see the request again).<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2058\" rel=\"attachment wp-att-2058\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2058\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest10-1024x528.png\" alt=\"\" width=\"960\" height=\"495\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest10-1024x528.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest10-300x155.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest10-768x396.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest10.png 1309w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">And finally, someone should delete the branch. Is that the person who created the branch? Is that the person who maintains the repository? No idea! I\u2019d delete my own, to keep things tidy \u2026 but I wouldn\u2019t be offended if the maintainer deleted it either.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=2059\" rel=\"attachment wp-att-2059\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2059\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/01\/GitPullRequest11.png\" alt=\"\" width=\"990\" height=\"256\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest11.png 990w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest11-300x78.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/01\/GitPullRequest11-768x199.png 768w\" sizes=\"auto, (max-width: 990px) 100vw, 990px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p class=\"MsoNormal\">\n","protected":false},"excerpt":{"rendered":"<p>I have finally run through the process of submitting a pull request to suggest changes to a Git repository. Do the normal &#8216;stuff&#8217; either to make a new project or to clone an existing project to your computer. Create a new branch and check out that branch. C:\\ljr\\git&gt;git clone https:\/\/github.com\/ljr55555\/SampleProject Cloning into &#8216;SampleProject&#8217;&#8230; remote: Counting &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[233,494,495],"class_list":["post-2048","post","type-post","status-publish","format-standard","hentry","category-coding","tag-git","tag-github","tag-pull-request"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/2048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2048"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/2048\/revisions"}],"predecessor-version":[{"id":2060,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/2048\/revisions\/2060"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}