This site is from a past semester! The current version will be here when the new semester starts.

Week 7 [Fri, Sep 17th] - Tutorial

Guidance for the item(s) below:

By the end of this tutorial, we want to confirm that you are able to apply Git and GitHub techniques you learned so far to follow a systematic workflow when updating the code.

1 Set up tP org/repo

  • To be done in Zoom breakout rooms (per team).
  • Set up the team org, team fork, individual forks as described below:

  • [Each person] Verify that you know how to do the following by performing each on your computer and posting a screenshot in the tutorial workspace document:
    • run the code in your IDE
    • run I/O redirection tests
    • verify compliance with the coding standard automatically using Gradle

2 Update the code using the forking workflow

In this activity you will be using the forking workflow to do some simple updates to the code base while working in parallel. The objective is to ensure you know how to follow the expected working in the tP. The steps are given below:

First, ensure that you know how the forking workflow works.

Next, add the upstream as a remote: The forking workflow requires you to pull from the team repo and push to your own fork. To be able to do the former, you need to add the team repo as a remote of your clone. Follow the instructions in the panel below to add a new remote with the Remote name upstream (can be anything, but upstream is a common choice) and URL / Path pointing to the team repo
e.g., https://github.com/AY2122S1-CS2113-T09-2/tp.git (note the .git at the end)

Now, follow these steps to update the code using the forking workflow e.g., each person can add their details to the docs/AboutUs.md page:

  • Step 1 Decide which update each person will do.
  • Step 2 Each person,
    • Step 2.a create a branch (e.g., johnDoe-AboutUs) in their local repo.
    • Step 2.b do the change in the branch.
    • Step 2.c push the branch to their own fork.
    • Step 2.d create a PR from their branch in the fork to the master branch of the team repo.
  • Step 3 Work as a team to merge one PR at a time.
    • If a PR cannot be merged due to conflicts, resolve conflicts as you go (PR conflict resolution was covered in the week 6 lecture activity).
    • Do not send PRs from team repo to individual repos as that goes against the forking workflow. PRs should only go from forks to the team repo.
    • For reference, PR merging instructions are in the following textbook section:

  • Step 4 Everyone sync their local repo and the fork with the team repo (see the last paragraph in the panel above)

Follow up notes for the item(s) above:

The workflow you followed above is very safe but has a high-overhead. You may simplify your workflow (at your own risk) after following the above workflow for a while.