{"id":304396,"date":"2021-07-21T14:00:31","date_gmt":"2021-07-21T11:00:31","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/what-are-git-pull-requests-and-how-do-you-use-them-cloudsavvy-it\/"},"modified":"2021-07-21T14:00:31","modified_gmt":"2021-07-21T11:00:31","slug":"what-are-git-pull-requests-and-how-do-you-use-them-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/what-are-git-pull-requests-and-how-do-you-use-them-cloudsavvy-it\/","title":{"rendered":"#What Are Git Pull Requests, And How Do You Use Them? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a23b120e9336\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a23b120e9336\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/what-are-git-pull-requests-and-how-do-you-use-them-cloudsavvy-it\/#What_Does_a_Pull_Request_Do\" >What Does a Pull Request Do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/what-are-git-pull-requests-and-how-do-you-use-them-cloudsavvy-it\/#The_Backbone_Of_Open_Source_Collaboration\" >The Backbone Of Open Source Collaboration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/what-are-git-pull-requests-and-how-do-you-use-them-cloudsavvy-it\/#Making_Pull_Requests\" >Making Pull Requests<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#What Are Git Pull Requests, And How Do You Use Them? \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-2266\" srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/e713ed70-1.png?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/e713ed70-1.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/e713ed70-1.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Git logo\" width=\"700\" height=\"299\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Pull Requests are a feature of online git services like Github and Gitlab. They allow anyone to request for changes to be added, even if they don\u2019t have access to the repository. We\u2019ll discuss how they work, and how to use them for open source collaboration.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"What_Does_a_Pull_Request_Do\"><\/span>What Does a Pull Request Do?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Despite how it may seem, <code>git<\/code>\u00a0as a tool is a completely decentralized system. What that means is that the repository on Github.com, and the repository on your local machine, aren\u2019t any different from one another. You\u2019re not connecting <em>to<\/em> Github to work on a repository, you\u2019re copying the code <em>from<\/em> Github into your local repository, and working on it there.<\/p>\n<p>When you want to push changes, you can make commits and run <code>git push<\/code>, sending your updates to a given \u201cremote,\u201d which can be any other Git repository, but usually is an online hosted service like Github, Bitbucket, or Gitlab. This updates the remote repository to be in sync with your repo.<\/p>\n<p>However, this only works when you have permission to push commits, usually configured with a password or SSH key. This is only given out to members of the organization in control of the repo, otherwise, everyone could alter the Git history. If you\u2019re not a member of the organization, what are you to do when you want to make changes?<\/p>\n<p>Well, there\u2019s a second way that a Git repository can get updated\u2014<code>git pull<\/code>. You probably do this a lot whenever your coworkers make changes that get pushed. In that case, you\u2019re pulling down commits from the remote repository, and syncing it with your local repo.<\/p>\n<p>But, Git is decentralized, so there\u2019s really no difference between your repo, and the remote repo. You can actually run <code>git pull<\/code>\u00a0in reverse, from the server, and this is the heart of what makes pull requests function.<\/p>\n<p>A pull request is just you telling the remote server (and the people who maintain it) that you have some updated commits that you would like them to look over and integrate with the remote repository. If they accept the changes, the remote repo will run <code>git pull<\/code>\u00a0against your local repository, integrating the code without you ever having to have an SSH key authorized to do so.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"The_Backbone_Of_Open_Source_Collaboration\"><\/span>The Backbone Of Open Source Collaboration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Pull requests are used constantly for open source libraries. After all, much of the reason for open source is that any developer can contribute to the project if their code is useful.<\/p>\n<p>Pull requests are what makes that work. The project\u2019s maintainers, the administrators in control of it, are the ones that typically review pull requests and decide whether or not to integrate the code, or whether certain bugs need to be fixed before it\u2019s ready.<\/p>\n<p>Pull requests aren\u2019t exactly a feature of <code>git<\/code>\u00a0itself, so the exact implementation of them will vary depending on the service. But, for Github, you\u2019ll find pull requests in the menu bar of a repository, which shows a list of open and closed requests that you can filter through.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12853\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/59e2d25e.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"323\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you click on any one of them, you can view the comments made by the requester, as well as the commits associated with it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12854\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/88bed937.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"509\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you\u2019re the maintainer of the repository, you can review and merge the request. Or, if you have issues with it you need to discuss, you can leave a comment and work on the code together. This is a big reason why public spaces like Github are great for open source collaboration, even something as simple as changing the wording of the documentation can be done collaboratively by anyone.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12856\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/cb68162f.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"656\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Pull requests are different from issues. Issue tracking is a feature of many services like Github that allows easy bug fixing and public collaboration for new features. Essentially, each issue has a topic that can be discussed by the maintainers and the community. For example, <code>dotnet\/csharplang<\/code>\u00a0is the official repo for discussion around how C# as a programming language is designed. If you go to the issues, you\u2019ll find many people discussing concepts for future iterations of the language:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12855\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/90ac093d.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"287\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Not all issues lead to pull requests. If the issue is fixed by the maintainer, it won\u2019t matter. If the issue is fixed by a collaborator, they will need to submit a pull request.<\/p>\n<p>All pull requests are either denied or lead directly to code changes in the repository. Issues are just a way to track development progress and which bugs need to be fixed.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Making_Pull_Requests\"><\/span>Making Pull Requests<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Again, the exact steps for this will vary depending on the service you\u2019re using, but most open source collaboration h<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ens on Github, so we\u2019ll show the steps for that.<\/p>\n<p>Head over to the repository you want to make a request for and click \u201cNew Pull Request\u201d under the Pull Requests tab:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12898\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/64c7ca42.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"281\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You have two options here. If you\u2019re a member of the repository, and want to merge your feature branch into the master branch, you can select the two branches.<\/p>\n<p>If you\u2019re working on an open-source repository, you will need to fork the repo, and push it to Github under your own account. Then, you can select \u201ccompare across forks\u201d to merge your master branch into their master branch.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12899\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/e0f9beeb.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"501\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Once done, the pull request will be open for discussion, and you will simply have to wait to hear back from the maintainers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12900\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/23e6edf8.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"443\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>In the meantime, you can check on the status of all pull requests you\u2019re involved in with the \u201cPull Requests\u201d tab in the main header bar.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/12533\/what-are-git-pull-requests-and-how-do-you-use-them\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#What Are Git Pull Requests, And How Do You Use Them? \u2013 CloudSavvy IT&#8221; Pull Requests are a feature of online git services like Github and Gitlab. They allow anyone to request for changes to be added, even if they don\u2019t have access to the repository. We\u2019ll discuss how they work, and how to use&#8230;<\/p>\n","protected":false},"author":1,"featured_media":304397,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/e713ed70-1.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-304396","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/304396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=304396"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/304396\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/304397"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=304396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=304396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=304396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}