{"id":34,"date":"2019-10-07T18:20:03","date_gmt":"2019-10-07T18:20:03","guid":{"rendered":"http:\/\/metajack.org\/blog\/?p=34"},"modified":"2019-10-22T14:25:59","modified_gmt":"2019-10-22T14:25:59","slug":"the-simplest-way-to-create-a-pull-request-and-contribute-code-to-open-source-projects-on-github","status":"publish","type":"post","link":"https:\/\/metajack.org\/blog\/2019\/10\/07\/the-simplest-way-to-create-a-pull-request-and-contribute-code-to-open-source-projects-on-github\/","title":{"rendered":"The simplest way to create a pull-request and contribute code to open source projects on Github"},"content":{"rendered":"\n<p>Make a github account<\/p>\n\n\n\n<p>Go to the project you want to contribute to<\/p>\n\n\n\n<p>Press the &#8220;fork&#8221; button<\/p>\n\n\n\n<p>Check out your forked copy of the project<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/YOUR_USER_NAME_HERE\/FORKED_PROJECT_NAME_HERE.git<\/code><\/pre>\n\n\n\n<p>Create a new branch and check it out (change &#8220;branch-name&#8221; to something descriptive of your work)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout -b branch-name<\/code><\/pre>\n\n\n\n<p>Make your changes<\/p>\n\n\n\n<p>Add each new or modified file to your commit :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add path\/to\/file\/file_name.c<\/code><\/pre>\n\n\n\n<p>Commit your change to your local branch<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m \"Add a comment about your changes here\"<\/code><\/pre>\n\n\n\n<p>Sync your fork in case there have been any additions to the primary repository since you started your work<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git remote add upstream https:\/\/github.com\/original-owner-username\/original-repository.git\ngit fetch upstream\ngit checkout master\ngit merge upstream\/master<\/code><\/pre>\n\n\n\n<p>Push your changes to your forked repository on github<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push --set-upstream origin branch-name<\/code><\/pre>\n\n\n\n<p>Go to the page on github for your forked repository and press the &#8220;Compare &amp; Pull Request&#8221; button. Follow the directions to create the pull request.<\/p>\n\n\n\n<p>(adapted from <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-create-a-pull-request-on-github\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-create-a-pull-request-on-github<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Make a github account Go to the project you want to contribute to Press the &#8220;fork&#8221; button Check out your forked copy of the project Create a new branch and check it out (change &#8220;branch-name&#8221; to something descriptive of your work) Make your changes Add each new or modified file to your commit : Commit &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/metajack.org\/blog\/2019\/10\/07\/the-simplest-way-to-create-a-pull-request-and-contribute-code-to-open-source-projects-on-github\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;The simplest way to create a pull-request and contribute code to open source projects on Github&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[7,10],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-programming","tag-git","tag-github","entry"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":5,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":66,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions\/66"}],"wp:attachment":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}