Course · Build apps with AI · Session 4

Work as a team:
branches and pull requests

Continue your S3 project with one branch per change. Learn to review the diff, describe tests and decide what can go into main, with AI assistance.

Format
Self-paced and online
Estimated time
About 2.5 hours, over one or more sittings
Essential
Branch → PR → review → merge
Optional
Try the challenge with a partner
Review before integrating. Branch → small change → tests → PR → review → merge. Review reduces risk but does not guarantee error-free code. Merging and publishing remain separate steps.

↩From session 3: you have your GitHub repository, know commit / push / pull and use the context method. Until now you worked on main. Today you stop editing it directly.

Complete this session online, at your own pace. Aim to finish with at least one pull request prepared and merged. If you take the optional classroom route, this repository will support the team exercise.
Step 0 · Which AI chat will you use?

Choose an available, authorised tool. An external chat needs you to attach the material; an agent can read files within its permissions. In both cases, you review the result.

Today’s path
Progress: 0/6
Optional challenge · With a partner

Review with another person (optional)

You can compare your review with another person. If possible, try this challenge with someone from work, your studies or this course:

  1. In your repository: Settings → Collaborators → invite an authorised person to the practice repo with the permissions they need. Review access when the collaboration ends.
  2. Your partner creates a branch in your repo, makes a small change and opens a pull request.
  3. You review it (read the diff and ask AI for help if useful) and merge it when ready.

You have practised a shared change and review. The full team workflow (a shared repository and protected main) is an optional challenge in session 5.

Record the change, tests and pending work in the S4 and S5 tracking worksheet.

Before you finish…

Review your change and tick only what you have checked:

Take this with you: main is the shared baseline. Integrate small, reviewed and tested changes; keep a way to recover them.
In session 5 (online): prepare a repeatable publishing process from GitHub (with clasp), first manual and then automatic if you choose. There is also a team exercise for the optional classroom route.

Check your understanding

This is for you, not an exam or a grade. Think through your answers, then compare them below.

  1. Why work on a branch instead of changing main directly?
  2. What is a pull request? Does opening one merge it?
  3. In the diff, what do green and red mean? Who decides to merge?
See the answers ▾

1. The branch separates the change’s commits until they are integrated into main. It does not automatically separate Google data or deployments.

2. It is a request to merge the branch into main. Opening it merges nothing: review comes first.

3. Green (+) = added, red (−) = removed. You decide: AI offers pointers, not orders.