Lab 2
Lab 2
Overview
Pull requests let your team give feedback on changes in feature branches
before merging the code into the master branch. Reviewers can step
through the proposed changes, leave comments, and vote to approve or
reject the code. GitHub and its Visual Studio Code extension provide a rich
experience for creating, reviewing, and approving pull requests.
Prerequisites
The Git with GitHub lab is required to be completed as a prerequisite
for this lab.
2. Navigate to the Settings tab. This lab will involve creating a pull
request designed to address an issue documented in the project,
which we will define before getting started.
7. The new issue should be created with ID 1, but make a note of the ID
in case it's different.
Task 2: Creating a new pull request
1. Return to Visual Studio Code.
4. Search for "sign in" and click the option to sign in to GitHub for the
pull requests extension.
6. Select the Source Control tab. It should recognize that you have
uncommitted changes to Category.cs. Enter a comment
of "Category change. Fixes #1." (update the ID if needed to
match the issue you created earlier) and press Ctrl+Enter to
commit to the local release branch.
7. Click the Synchronize Changes button to push the commit to the
server branch.
8. Select the GitHub Pull Requests tab and click the Create Pull
Request button.
2. The diff viewer is used to show the difference between the code in
the master and release branches.
3. Click the Add comment button next to the added line, enter a
comment, and click Start Review.
6. Besides the pull request navigation view, you can also use the
shortcut at the bottom of the window to return to the current pull
request.
10. You can review all of the pull request details from this merged
pull request, including the commits and conversations. Click the
work item identified in the commit to see that it was automatically
closed when the pull request was merged.
11. As expected, the issue is now marked Closed.
2. Select Branches.
3. Policies are enforced by following rules that match the target
branch. Click Add rule to create a new one.
7. There are additional options for requiring signed commits and also
for requiring that administrators follow these pull request
restrictions. Click Create to create the rule.