No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Group Git practice

This lab follows the Group Git Lecture

The purpose of this lab is get practice merging branches, rebasing branches, and resolving conflicts.

We will be working in teams!


Pick one member of your team to do the following.

We need to do some one time setup that we don't do when we fork repos. We want to do this lab as if this is your own repo that has no not been forked from anywhere.

  • Clone this repo
  • Create a new public repo on GHE called LAB_U03_D08_Group-Git
  • cd into your local repo and change the origin remote git remote set-url origin YOUR-GIT-URL
  • To make sure you don't accidentally lose your local branches do this now:
git co option-args && git co person-gender && git co forgotten-semicolons && git co master
  • Push all branches up: git push --all
  • In Settings > Collaborators add all of your team members.

All of your work will happen in your new repo. You are not making any PRs to the original repo


Once one member has done this, everyone else should clone their repo (no forking). Everyone will be working from this one repo so there will be no committing to master.

Step 0 (as a team)

Merge branches into your own repo.

  • Make PRs for each branch
  • Comment on each PR, and merge in the following order
    • option-args, person-gender, forgotten-semicolons
  • After merging the first, you will have to rebase each one! Muhahaha...
    • Push the rebased branch back up, review and merge
    • Repeat for other branches

Make sure at least one person reviews each PR. There should be at least one LGTM on each PR before merging and no one should hit merge on their own PR.

Step 1 (as a team)

One member will:

  • Checkout a branch called add-people
  • On the bottom of person.js, add let people = [];
  • Create a PR for this branch, review it, and merge it

Step 2 (each member)

Each member must do work on his/her own branch but help each other out as a team!

  • Each person on your team should check out their own branch from master
    • eg: git checkout add-stacey-to-people (replace stacey with your name)
    • Create yourself and add yourself to the array
    • Make a PR for your branch
  • Once everyone has made a PR, review each one and merge. After the first, everyone will have to rebase their branch!

Step 3 (each member)

After everyone has completed step 2:

  • Check out a branch to give your name a prefix or suffix
    • eg: git checkout change-stacey-to-capt-stacey
    • Make a PR but do not yet merge

Step 4 (as a team)

After everyone has completed step 3:

  • Checkout a branch called rename-Person-to-Student
  • Rename the Person class to Student
    • You will also need to update any references to Person
  • Create a PR for this branch, review it, and merge it

Step 5 (each member)

After rename-Person-to-Student is merged

  • Each remaining PR should now have a conflict with master
  • Resolve these conflicts and push your branch back up
  • Have someone review it, then merge it

Step 6 (as a team)

Give your code-base one final check

  • Each PR should be merged
  • You should have an array of Student instances (from step 4)
  • Each student should have a prefix or suffix (from step 3 and 5)

Example of final code:

const Student = function (options) { =;
  this.age = options.age;
  this.gender = options.gender;

Student.prototype.sayHi = function () {
  console.log(`Hi, I am ${}.`);

var stacey = new Student({name: 'Capt Stacey Winnatour IV', age: 30, gender: 'female'});
var tracey = new Student({name: 'Miss Lacey Wininghamm JR', age: 36, gender: 'female'});
// ...

var students = [stacey, tracey, lacey, macey];