-
Notifications
You must be signed in to change notification settings - Fork 1
Task 4 — Conducting a Code Review
Code reviews are an opportunity for other team members to read over your changes before they are merged into main, helping to catch any problems before they have a chance to break things.
Although pull request authors can't approve their own pull requests (that'd be cheeky), we can simulate the process.
- From the pull request, click on the
Files changedbutton below the title.
- Examine the diffs that are being shown to you—this page shows everything that has changed between the branch being merged (
readme-name) and the branch being merged into (main).💡 Note
If you are unsatisfied with something, you can click on the specific line and leave a comment to request changes before merging.
- Once you are satisfied, click the
Review changesbutton in the top right, selectComment, and leave an approval comment.💡 Note
As you'd expect, you'd usually clickApproveif you weren't the pull request author.
-
Click
Submit review. -
Once you are returned to the pull request, click
Merge pull request, followed byConfirm merge.
- Switch to the
mainbranch,pullany changes (if you are checking from your local machine), and checkREADME.md—you should now see your name!
This process might seem like a bit of a hassle, and, for such a simple change, it is—but consider working in a team with multiple developers all working on their own tasks, changing the same files—it would very quickly devolve into a nightmare.
🎉 Congratulations!
You have just completed your first code review, and merged your first branch!
For help on using Git and GitHub, you may:
- Refer to the
Getting Started with GitHubworkshop provided on Canvas - Ask for help on Slack, Ed Discussion, or in the labs
- Refer to https://git-scm.com/book/en/v2