Lab: Pull Requests
Due: Wednesday, October 28 at 11:59pm (one week after it is assigned) Worth: 2 points
Starter code: github.com/rtealwitter/pullrequest-tutorial
Git is difficult to learn but standard in software development. It provides a consistent workflow for saving, sharing, and combining code, including code written with AI tools.
This lab covers three features for collaboration: branching, merging, and pull requests. Earlier labs used git to submit individual work. Here, you will use it to combine changes from multiple contributors.
Getting the code
Fork the starter repository, github.com/rtealwitter/pullrequest-tutorial, to your own GitHub account with the Fork button. You now have your own copy that you are allowed to push to.
Clone your fork to your laptop and open the folder in VS Code:
$ git clone https://github.com/<your-username>/pullrequest-tutorial $ cd pullrequest-tutorial
Part 1: the terminal and git
Inside the repository you just cloned is a folder named git-tutorial with its own README. Work through it top to bottom, typing every command into your terminal as you go. It is a self-guided walkthrough (you can also read it on GitHub), and it covers the core of everyday git:
- committing changes and reading your history with
git log, - branching, so you can build a feature without disturbing the working version,
- merging a finished branch back in,
- resolving a merge conflict by hand, when two branches change the same line,
- and cleaning up branches once you are done with them.
The tutorial includes commands we have not covered in class, so you will also practice following technical documentation about unfamiliar material. There is nothing to submit for this part; it sets up the pull request in Part 2.
Part 2: your first pull request
The README of the repository you forked has a deliberate typo in its title: it reads Tutrial where it should read Tutorial. Fix the mistake and offer the change back with a pull request, a proposed change to someone else’s repository that the owner can review and merge.
This workflow spans your fork and the original repository. Create a branch on your fork, fix the typo, commit and push the change, then open a pull request against the original repository. For the exact click-by-click steps, follow this seven-step procedure. The procedure is written for working programmers, so adapt it to this repository as needed.
Note. Since everyone submits the same pull request for this one intentional typo, these particular pull requests will not be merged. But if you ever find a genuine mistake in a class repository, send a pull request to fix it. It will be accepted, you will get extra credit, and everyone benefits from the correction.
Submitting
The pull request is the deliverable. Add a root-level submission.toml containing exactly this evidence field:
pull_request_url = "https://github.com/rtealwitter/pullrequest-tutorial/pull/123"Replace 123 with your pull request number, commit the manifest, and submit your GitHub repository and branch to the Gradescope Programming Assignment. The instructor-owned grader checks the correction and the evidence format offline and is authoritative; a GitHub Action is only preliminary feedback. The instructor may separately verify the PR’s live status if GitHub is unavailable to the grader.
Later group projects will use the same fork-and-pull-request workflow.