Creating a Pull Request2:50 with Jay McGavren
A pull request, PR for short, is a discussion regarding a set of commits on a Git hosting service such as GitHub or Bitbucket. (GitLab has a similar feature called "Merge Requests".) Although a pull request can cover any set of commits, most often it's a comparison between one branch and another. The most common use for a pull request is to let another person who you're working on a repo with review your changes before they get merged into the `master` branch and deployed to users.
A pull request or a PR for short, is a discussion regarding a set of commits on 0:00 a Git hosting service such as GitHub or bitbucket. 0:05 Gitlab has a similar feature called merge request. 0:09 Although a pull request can cover any set of commits, 0:12 most often it's a comparison between one branch and another. 0:15 The most common use for a pull request is to let another person who are you working 0:19 on a repo with, review your changes before they get merged into the master branch and 0:23 deployed to users. 0:27 This is a chance to discuss whether the new feature is really a good 0:29 fit with the rest of the product, to catch bugs, or to report style inconsistencies. 0:32 In this course we'll show how this is done on GitHub but the process is similar for 0:38 other services. 0:42 To create a pull request, you first need to push commits to a branch on a GitHub 0:44 repository, just like we did in the last video. 0:48 Then you can visit your GitHub repo in your web browser. 0:52 If you just push the branch, you might see a shortcut alert with a button that will 0:56 let you create a pull request based on that branch. 1:00 But in case that shortcut isn't displayed for some reason, we'll skip it and 1:03 show you how to do it the slightly longer way. 1:06 First, you click on the new pull request button. 1:08 Then you choose the branch you're going to want to merge into. 1:12 The default will be the repository's primary branch, usually master. 1:15 And in most cases, you'll wanna leave that at the default. 1:19 Then you choose the branch you want to compare to. 1:22 This will be the branch you push to your GitHub repository. 1:25 The screen will update. 1:31 At the bottom, you'll see all the commits that are on the new branch, but 1:32 not on the branch you want to merge into. 1:35 You'll also see the combined diff of all those commits. 1:38 These changes may affect just one file, or several files. 1:41 Back up at the top, 1:45 you can write a quick one line summary of what your pull request does. 1:46 And you can optionally write a multi-line description below that. 1:52 This is a good place to discuss technical details regarding the changes, 1:56 things that you think the person reviewing the pull request should try 2:00 when testing it, and more. 2:03 Many teams agree on a set of info that should be included in 2:05 the pull request description. 2:08 They may even provide a template you'll need to fill in. 2:10 Be as thorough as you can here. 2:13 Your reviewer's goal is to help you catch bugs and 2:15 other issues before users see them. 2:18 You can help then in this task by providing an accurate and 2:20 detailed description of your changes. 2:23 There will be an option to request a reviewer on the pull request. 2:26 If you want, you can click on that to specify a particular member of your team 2:30 who you think should look the changes over. 2:33 That person will receive an alert with a link to your pull request. 2:36 Once you have everything filled out to your liking, 2:40 you can click the button to create a pull request. 2:42 Your pull request will then appear in a list of PRs on the repo's page. 2:46
You need to sign up for Treehouse in order to download course files.Sign up