A paired collaboration game. You and your partner play tic-tac-toe by committing and pushing moves to a shared GitHub repository.
Decide who is Player X (first mover) and who is Player O (collaborator).
- Click Use this template > Create a new repository.
- Go to Settings > Collaborators > Add people, and invite Player O by their GitHub handle.
- Register your game to display your board on the workshop Game Wall.
- Clone the repository locally:
git clone <your-repo-url> cd <repo-folder>
- You are ready to make Move 1!
- Accept the invitation via email or GitHub notifications.
- Clone the repository locally:
git clone <repo-url> cd <repo-folder>
- Wait for Player X to push Move 1. Once they tell you "Your turn!", begin your turn cycle.
Every turn follows these five steps in exact order. Always pull before editing!
git pull origin mainOpen board.txt in your text editor. Replace one empty square ([ ]) with your mark ([X] or [O]), then save the file.
Verify your diff and stage board.txt:
git status
git diff
git add board.txtgit commit -m "Move 1: X in center square"git push origin mainTell your partner: "Your turn!"
-
Push Rejected (
[rejected] main -> main (fetch first)): Your partner pushed before you fetched. Run:git pull origin main git push origin main
-
Merge Conflict in
board.txt: Openboard.txt, resolve the conflict markers (<<<<<<<,=======,>>>>>>>), save, and run:git add board.txt git commit -m "Resolve merge conflict in board.txt" git push origin main -
Mistake or Typo: Never force push (
git push -f). Simply fixboard.txt, commit the fix, and push:git commit -am "Fix: correct square" git push origin main
Finished your match early? Play a rematch on a dedicated branch to keep your first game history intact on main:
-
Player X creates and pushes the branch:
git checkout -b rematch git push -u origin rematch
-
Player O fetches and switches to the branch:
git fetch origin git checkout rematch
-
Reset
board.txtback to empty squares ([ ]), commit, and push:git commit -am "Start Rematch Game 2" git push origin rematch -
Play your rematch on the
rematchbranch!