Skip to content

Latest commit

 

History

History
159 lines (106 loc) · 5.77 KB

File metadata and controls

159 lines (106 loc) · 5.77 KB

Multiplayer Git

Learning Goals

  • Collaborate with others in a shared GitHub repository
  • Practice the push/pull cycle with teammates
  • Handle situations where multiple people push to the same branch
  • Work through merge conflicts as a team

Introduction

Everything up to this point has been a solo exercise — you've been the only person working in your repository. In the real world, you'll be working with other people, and that introduces new challenges:

  • What happens when two people change the same file?
  • How do you stay up to date with your teammates' changes?
  • How do you coordinate who's working on what?

This exercise uses the Multiplayer Git workshop from eficode-academy/multiplayer-git, which is designed specifically for practicing team collaboration with Git and GitHub.

💡 You'll need at least 2-3 people to do this exercise. If you're working through these katas alone, find a partner or come back to this exercise during a group session.

Exercise

Overview

The Multiplayer Git exercises are hosted in a separate repository. You'll:

  1. Form a team of 3-4 people
  2. Elect a team leader who creates a shared repository from a template
  3. Everyone clones the shared repo
  4. Work through exercises that practice real collaboration scenarios

Exercises in the Multiplayer Git workshop

The workshop consists of four exercises:

Exercise Description
Exercise 0 Getting started — Form teams, create the shared repo from the template, invite collaborators, everyone clones
Exercise 1 Push and pull — Everyone creates files and practices the push/pull cycle on main
Exercise 2 Merge conflicts — Experience and resolve conflicts when multiple people change the same file
Exercise 3 Branching together — Work on separate branches and merge via Pull Requests

Prerequisites

Before starting the multiplayer exercises, make sure everyone in your team has:

  • ✅ Completed exercises 00–02 of this GitHub Katas workshop
  • ✅ A GitHub account
  • ✅ Git installed and configured (user.name and user.email)
  • ✅ Authentication set up (HTTPS with PAT or SSH key)

Getting started

Step by step

Step 1: Form your team

  • Break into groups of 3-4 people (or whatever the instructor suggests)
  • Elect a team leader
  • Choose a fun team name

Step 2: Team leader creates the repo

The team leader should:

  1. Go to eficode-academy/multiplayer-git
  2. Click Use this templateCreate a new repository
  3. Name it <team-name>-multiplayer-git
  4. Make it Public
  5. Go to SettingsCollaboratorsAdd people and invite your team members

Step 3: Everyone clones

Once you've accepted the invitation, clone the team repo:

git clone https://github.com/<team-leader-username>/<team-name>-multiplayer-git.git
cd <team-name>-multiplayer-git

Step 4: Work through the exercises

Follow the exercises in order:

  1. Exercise 0: Getting started
  2. Exercise 1: Push and pull
  3. Exercise 2: Merge conflicts
  4. Exercise 3: Branching together

💡 Communication is key! Talk to your teammates about what you're doing. Many of the "problems" in these exercises are solved by simply coordinating with each other.

Tips for the multiplayer exercises

💡 Common issues and how to handle them

"I can't push — it says my branch is behind"

This means a teammate pushed changes since your last pull. Pull first, then push:

git pull
git push

"I got a merge conflict!"

Don't panic. Git is telling you that you and a teammate changed the same lines. Open the conflicted file and look for conflict markers:

<<<<<<< HEAD
your changes
=======
their changes
>>>>>>> origin/main

Edit the file to keep the right version (or combine both), then:

git add <conflicted-file>
git commit -m "Resolve merge conflict"
git push

"Someone wasn't added as a collaborator"

The team leader needs to go to SettingsCollaborators and add them. The person will need to accept the invitation via email or GitHub notifications.

Summary

Congratulations! You've completed the GitHub Katas workshop! 🎉

You've gone from Git basics to real team collaboration:

Exercise What you learned
00 — Git Basics init, add, commit, log, diff — the local foundation
01 — Working with GitHub Creating repos, cloning, pushing, fetching, pulling
02 — Branches and PRs The branch → PR → merge workflow
03 — Multiplayer Git Real collaboration with teammates

What's next?

Now that you have the fundamentals, here are some topics to explore:

  • GitHub Issues & Projects — Track work and plan features
  • Code Review — Give and receive feedback on Pull Requests
  • GitHub Actions — Automate testing and deployment
  • GitHub Pages — Host a website directly from your repo
  • Open Source — Contribute to projects using the fork-and-PR workflow

Happy coding!