Up and Running with Git Transcripts
Chapter: Teamwork: Open source and Pull Requests
Lecture: Review and accept the PR (pull request)

Login or purchase this course to watch this video and the rest of the course contents.
0:00 The outside contributor has made their changes. They push those changes up to git hub.
0:05 Now remember the pull request the git flow all of this stuff forking. This is not a git feature. So in order to do the pull requests,
0:16 we can't do it through just our git tools. We need to go back to git hub. And when we do notice it says blizzard,
0:23 alligator has had some push recent push two minutes ago and it suggests, would you like to take those changes and turn them into a pull request?
0:34 Yes, yes, we do. We want to create the pull request. So here's our time to actually reach out back to mike.
0:40 C Kennedy the owner of the original project and say I have this idea for you
0:43 So it says the original repository and branch is going to be Mike Ci Kennedy sketchy rock paper scissors on their main branch.
0:54 And where it's coming from is talk Pythons, rock, sketchy rock paper scissors on the lizard alligator branch. So we'll say new feature, lizard,
1:04 alligator. Here's a great new feature, replace lizard with alligator. Going to create this new feature,
1:16 create pull request. It's a little bit odd because I'm both in both places. But let's go ahead and create the pull requests. Now. If we go over here,
1:27 the original developer should now see one pull request right there. Come in here and say, Okay, we have an open one again.
1:34 This would be the user who originally created the thing from their repository. You see All right? They want to go from they want to commit into the
1:44 main from talk Python, lizard alligator and I could actually click here and open this up, go to their fork and see what's been going on over here.
1:53 Right? There could be conversations and all sorts of stuff. Okay, great. And says here's a new feature and this is the commit.
2:02 So I can actually click on this to see what the commit details were. So The message was just lizard alligator. When was it done? Here's the changes.
2:11 2-3 and all the lizard alligator changes. That looks pretty decent. Go back here. We could see if there were checks,
2:20 we could set up continuous integration and when this pull request came in, maybe it would automatically run our unit tests. And if the unit test fails,
2:28 you could just straight away say no, no, no. We're not going to accept this because clearly it doesn't work or code formatting is wrong or whatever.
2:35 And you can also just see a more focused list of the files that were changed
2:39 Right? There could be multiple requests so there could be multiple commits.
2:44 Remember our feature branches sometimes have more than one commit to it and that could show
2:48 up over here. Okay, down here the Git hub says we did a little
2:55 check and we verified that there's gonna be no merge conflicts so that automatic merge that it does. That's going to work perfectly.
3:06 We could go over here and set up some reviewers. I could assign myself as the person who was going to be in charge of reviewing
3:12 and processing this pull request here. You can see it got put over there. I could label this as it's gonna be an enhancement.
3:22 We could put it into projects, milestones, notifications, all those things again.
3:26 You would see two participants if it wasn't me doing this back to myself. Alright, so we've reviewed it,
3:34 we might be wanting to push this button and merge it and boom. Now we have version 23 of the game.
3:40 We've automatically applied it and often you know that might be what happens right? We can look here, we can see the changes you're like.
3:47 Yeah that is totally golden. But what if we want to check it out? Oftentimes you're like, I really want to see this feature in action so we could
3:58 go over and we could go to their repo and their branch and check that out But watch this. Remember we talked about how awesome the tools were.
4:07 Show you one more super sweet tool trick technique here. We can go to our rock paper scissors here.
4:14 This is the Mike C Kennedy version that we've been working on. Just do update project from git pressing this or command T.
4:22 Is what I actually did And so far we've been working here with local changes.
4:27 There are none. Remember we are on lizard version 2-2 and we've been working with this to push the changes.
4:34 There are none. But you may have noticed right below those two that there's a pull request. Check this out now there's an open pull request right here.
4:47 So PyCharm actually says look you can go in and open up the details, look at this. So here's the new pull, a new feature. PR number one.
4:55 It came from this character. Right? Again that would be someone else not you. So some other person created this pull request.
5:04 They did the commit this one which is a lizard alligator and then I this is now me again as the owner added enhancements and assigned myself.
5:13 So that's cool. We can view the conversations around it and I could do merge I could close it right.
5:20 I could actually manage the pull request from down here or check this out. I can check it out. Blizzard alligator pr let's call it that created.
5:32 So look I've created a branch from there from that check in and I've checked it out right here. You can see lizard alligator.
5:43 Pr remember as the owner of that repository I never made a lizard alligator thing. This is the first I've heard of it.
5:49 I woke up this morning and hey you have this pull request interesting So we can come over here and now look it's 23 and it's alligator.
5:57 Let's go and run it and see what happens. I'm gonna try this alligator out. Oh no no no no no the scissors beat the alligator so rough.
6:06 Alright, let's keep switching to Spock. It's only logical. Yes, we beat him finally with Spock. Yeah, that's cool. I like this enhancement.
6:19 I totally do. So everything looks good. I've got a chance to check it out and play with it. A pull request is nice and fun.
6:27 So yeah, sure enough. I'm ready to come back here to git hub and say great, let's merge it. So mike, C Kennedy merged.
6:37 This one. I would say something like this is great. Thank you at Mike. C Kennedy referencing the by name.
6:45 What is it? And now we've successfully done this. So we can say we're going to delete that branch right?
6:51 The pr has been accepted so we can delete the branch. Perfect. It's been merged back 14 seconds ago.
7:00 So now if I go back over here and I check out the main branch, close that off. Notice that PyCharm rearranges the windows right now we're still back
7:13 on the lizard Spock version because we haven't sync with the server. What we did was on git hub.
7:20 But if we go over here and just do get us the latest changes, we should now have the latest version of the software up on.
7:28 Git hub. Let's go and see what's going on here. So here you can see game 2-2 lizard. Alligator in minutes ago. Fantastic.
7:35 On the main branch. In the main original open source repository for Mike C kennedy not the forked one from Talk Python.


Talk Python's Mastodon Michael Kennedy's Mastodon