Check out a free preview of the full Visual Studio Code Can Do That? course

The "Reviewing & Merging Pull Requests" Lesson is part of the full, Visual Studio Code Can Do That? course featured in this preview video. Here's what you'd learn in this lesson:

Burke explains how to create a new branch, merge, and use pull requests using VS Code and GitHub.

Preview
Close

Transcript from the "Reviewing & Merging Pull Requests" Lesson

[00:00:00]
>> Burke Holland: Now, the branch that we've got is only local. It's actually not in, we never published it, right? So it's still local. So if we look at, if we go back to our branches here, here, and we look, we've got a fixed description branch. So what we can do here is we can just tell, luckily, we can say Delete Branch text description, and it's gone.

[00:00:24]
So very powerful tools for just simply working with your Source Control. Now in real life, this is not a flow that you would use. The flow that you would more often use is that you would create a feature branch as a developer and that would be published to GitHub and then you would submit a pull request to merge your feature branch back into master.

[00:00:48]
That is the most common scenario. So I wanna sort of simulate that now. And because I can't simulate it with two people in the same order, what I've done is I have forked this repo into a different account called notburkeholland, just so we can keep these two people straight.

[00:01:04]
And what I wanna do is I wanna make a change. So I'm gonna go ahead and refresh this. So what I'm gonna do is I'm gonna come up here, and I'm actually looking at an older version. So let's, that's fine, we can still do this. So what I'm gonna do here is, I wanna change this and I wanna say.

[00:01:25]
>> Burke Holland: Let's take this out and say, we'll just do, we'll go back to the initial, I love lamp. Actually let's just do all caps, all of it. I ate a big red candle. And then just to switch it up, we'll put I love lamp down here. Okay, so I've now created a change here.

[00:01:46]
And I'm going to add a comment, description so much better.
>> Burke Holland: And I'm gonna go ahead and I'm going to commit to a new branch and start a pull request. I'm gonna propose a file change.
>> Burke Holland: And I'm going to create the pull request.
>> Burke Holland: Okay, and then I'm gonna go ahead and merge this.

[00:02:14]
So we'll merge this pull request. So emerging to my own repo here. I'm doing all this from GitHub. And now that I've done that, what I need to do is, I need to come back here and I need to do a new pull request to merge this to the upstream, okay?

[00:02:28]
So I've got I love lamp and then I'm trying to merge from this repo into this repo. So I'm gonna say create a new pull request, and like description is good now. It's okay. Okay, I'm gonna create the pull request, okay? Now, this cannot automatically be merged, because there were conflicts with the main branch, we're out of sync here.

[00:02:55]
So I'm gonna come back to VS Code, and there's an extension that I've included called GitHub Pull Requests. It's made by us, I think. Or GitHub which is also us. It's made by GitHub. So GitHub Pull Requests. And I'm gonna right click, I've got it hidden, there it is.

[00:03:16]
And I'm gonna come here and I'm gonna open this All right here. And now you see, look, that pull request is inside of VS Code. So if I expand this, I can click on Description and it will pull up this conversation that we're having, right? So no description provided, and I can say, can you be more specific?

[00:03:42]
And then say comment, and let's go back out. And if I'm not Berk, I'm actually now commenting with this person from within VS Code. So I can say, description was not good. Now it is. Right, because this is the kind of comments developers leave. This is what I've done, I fixed, I made it better.

[00:04:03]
I don't see what the problem is. And then if we come back here in VS Code, you have to do a quick Refresh here. But you'll see this comment come in, description was not good. Now it is. So what we can do is we can check out this pull request.

[00:04:18]
So now if you look down here we're on the PR, notburkeholland branch number four, and we can look at what's been changed. Right here, we can see the changes in the diff. So let's see, nice. You know what? That is better. I like it. So what we'll do is, we will, we can exit review mode here.

[00:04:43]
So I'm just gonna click Exit Review Mode. And, it wants us to check out. Let's not do that just yet. So let's switch back to master, here, and then we can merge, Merge Branch. Here's our PR, so we'll merge it and what do we have, merge conflicts. So we go back to Index, we can now accept the incoming change, save it and then go ahead and commit it.

[00:05:12]
>> Burke Holland: I guess, I just want this to be over, okay? Then we'll push it and then we'll come back and say on our item here, 0 pull requests. And if we go back and we refresh, this pull request has been merged by commit into master. So that's how you can work with pull requests directly from inside a VS Code.

[00:05:40]
Along with what I consider to be the most common workflow for VS Code in regards to Git.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now