CPSC 329 Software Development Fall 2026

CPSC 329 Lab 4: GitHub and Team Git

This lab introduces working in teams with Git, using GitHub for the shared repository. Part 1 is individual: setting up GitHub and practicing the basic solo workflow with a shared (central) repository — specifically, the distinction between committing (local only) and pushing/pulling (syncing with the remote). Part 2 is done with a partner: a full GitHub Flow workflow, including checking out an already-created project as a collaborator, feature branches, pull requests, merging, and resolving a merge conflict.

Objectives

Successful completion of this lab means that you:

Collaboration and AI

Labs are for learning and practice — you may help and be helped by others when it comes to figuring out what to do, but in the end you need to understand and be able to do the things for yourself.

In this lab, part 1 is individual — everyone needs their own GitHub account and needs to go through the setup themselves. Part 2 is done with a partner — while you'll each be working on separate computers and switching back and forth between who is typing, you are each responsible for understanding the whole process and not just the parts where you were at the keyboard.

You may not use AI to figure out what to do or to do the task for you.

Due Date, Deliverables, and Handin

due Fri 9/25 at the start of class

To hand in your work:


Preliminaries

Provided Code

You'll be working with a simple dog door simulation program. The provided version has a remote controlled dog door which closes automatically a bit after it has been opened.


Part 1: GitHub

In this part you'll set up a personal GitHub repository, connect it to an Eclipse project, and practice the difference between committing and pushing/pulling.

GitHub Account

GitHub is the largest and most widely used Git hosting service, especially for open-source projects, and it is the one you are most likely to encounter again. In addition to hosting Git repositories, it layers on collaboration features that Git itself doesn't provide, like pull requests for reviewing changes before they're merged and simple tools for managing who has access to a repository.

GitHub account creation notes:

Creating the Project and Local Repository

Start the same way you'd start any Eclipse project with Git, by creating the Eclipse project and sharing it to a local Git repository:

Creating the GitHub Repository and Pushing

So far the project lives only in your local repository. Time to push it to GitHub! Note that when you push, git isn't just sending your current code — instead, you must tell it which local branch should update which remote branch. This mapping is what a "ref specification" (or "ref spec") defines, and setting up the desired ref spec(s) is part of the push process.

Practicing the Cycle: Commit-Push

The basic individual workflow with a remote repository is commit-push: each time you have a working bit committed, do a push to send it to the GitHub repository.

Practicing Pull

At this point you are a solo developer using a single computer so no one else is making changes to the remote repository. However, GitHub lets you edit files directly in the browser — something you should generally be very cautious about! — which makes it possible to simulate a partner pushing their own changes without (yet) having a partner.

Pull is the mirror image of push: push sends changes from your local repository to the remote, while pull brings changes from the remote into your local repository.


Part 2: GitHubFlow

In this part, person A will create and own the shared repository; Person B will check it out as a collaborator. You'll each work on your own feature branch, and you'll deliberately create (and then resolve) a merge conflict. Keep in mind that both partners should be familiar with / understand both roles — that of repository owner and that of collaborator — so you should work through each part together (switching who is typing and whose computer you are using as indicated) rather than completing tasks independently in parallel.

Setting Up the Shared Repository

Person A:

Person B:

Now both partners should have an Eclipse project named lab4-pair which is linked to a shared GitHub repository and which contains identical copies of the starter code.

Workflow: Branches and Resolving Conflicts

Now you'll each work on the dog door simulator — Fido always coming back inside quickly is not very realistic. Person A will fix this by increasing Fido's time outside to 7500ms. Person B will instead make the time a random value up to 10000ms. (This is a bit contrived, but it makes it possible to ensure a conflict to be resolved.)

Start by creating a new branch for your work:

Person A:

Person B:

Implement the changes:

Person A:

Person B:

Merge the branches into main:

Person A:

Person B:

Workflow: New Features and Bug Fixes

This section is optional, but is encouraged for additional practice with branching, merging, and GitHub.

Now person A will add a new feature — a bark recognizer so the door will open automatically when Fido barks.

Person A:

Meanwhile, person B has realized there's a bug: Fido still manages to come back inside even if the door closes before he's done. Instead, he should bark to be let back in if the door has closed.

Person B:

Person A pulls in the bug fix from main before continuing with the bark recognizer:

Person A:

Now person A continues with the bark recognizer:

Person A:

Finally:

(both partners)