{"id":222,"date":"2023-02-10T18:34:12","date_gmt":"2023-02-11T00:34:12","guid":{"rendered":"https:\/\/mtu.net\/~jpschewe\/blog\/?p=222"},"modified":"2023-02-10T18:34:12","modified_gmt":"2023-02-11T00:34:12","slug":"github-pull-requests-and-issues","status":"publish","type":"post","link":"https:\/\/mtu.net\/~jpschewe\/blog\/2023\/02\/github-pull-requests-and-issues\/","title":{"rendered":"GitHub pull requests and issues"},"content":{"rendered":"\n<p>I have resisted using pull requests on GitHub for my own repositories because it seemed like I need to have have both an Issue and a Pull Request for each branch. I create Issues for fixes and features that I want to implement. During development I create a branch for the Issue and then once it&#8217;s finished and tested I manually merge with a merge commit and use the message of the merge commit to close the Issue.<\/p>\n\n\n\n<p>Recently I came across an article about converting a <a rel=\"noreferrer noopener\" href=\"https:\/\/jtway.co\/convert-github-issue-to-pull-request-c624834835d8\" target=\"_blank\">GitHub Issue to a Pull Request<\/a>. This solved my issue of having both an Issue and a Pull Request for each feature. I can create my Issues like normal and create a branch. Then when I push the branch I execute the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hub pull-request -i &lt;issue number> -b main<\/code><\/pre>\n\n\n\n<p>This converts the specified Issue number into a Pull Request and associates it with the current branch. I need the &#8220;-b main&#8221; because I have my push.default value set to &#8220;nothing&#8221; and it appears that &#8220;hub&#8221; can&#8217;t find the main branch with that setup.<\/p>\n\n\n\n<p>I&#8217;ve found a couple of benefits of using this pattern. One is that I can merge pull requests using the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/mobile\" target=\"_blank\">GitHub mobile app<\/a> on my phone. The other is that now it&#8217;s really easy to review the changes made for a feature and keep the discussion about the issue in the same place.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have resisted using pull requests on GitHub for my own repositories because it seemed like I need to have have both an Issue and a Pull Request for each branch. I create Issues for fixes and features that I want to implement. During development I create a branch for the Issue and then once &hellip; <a href=\"https:\/\/mtu.net\/~jpschewe\/blog\/2023\/02\/github-pull-requests-and-issues\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">GitHub pull requests and issues<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[21,22],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-github","tag-today-i-learned"],"_links":{"self":[{"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":1,"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/posts\/222\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mtu.net\/~jpschewe\/blog\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}