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