Git for Pairs Lab
Lab Objectives
- Practice committing, branching, merging, and pushing with a collaborator.
- Author, approve, comment upon, and merge Pull Requests.
Practice
This is a two-part exercise. In a group of two, decide who is Player 1 and Player 2. For the first part of this exercise, Player 1 will create a new repository and add Player 2 as a collaborator. In the second part, you will switch roles.
Part 1
Player 1 is the owner of the repo and will add Player 2 as a collaborator.
Player 1 has the following responsibilies:
- Create a repository titled
FavoriteRestaurants
. - Add a file that will hold a list of everyone’s favorite restaurants.
- Commit and push the main branch to Github.
- Add Player 2 as a collaborator.
- Create a new branch with your initials followed by the name (or abbreviation) of your favorite restaurant (e.g.
rt-red-lobster
). - In your branch, add a separate file with information on your favorite restaurant: name, location, why it is your favorite restaurant, your favorite dish, etc.
- Add your name and the name of your favorite restaurant to the list.
- Commit and push your branch to Github.
- Make a PR for your branch.
- Review and merge the PR from Player 2. Fix any merge conflicts.
- After both Pull Requests have been merged, pull the
main
branch from Github.
Player 2 has the following responsibilies:
- Accept the invitation from Player 1.
- Create a new branch with your initials followed by the name (or abbreviation) of your favorite restaurant (e.g.
mm-ruths-chris
). - In your branch, add a separate file with information on your favorite restaurant: name, location, why it is your favorite restaurant, your favorite dish, etc.
- Add your name and the name of your favorite restaurant to the list.
- Commit and push your branch to Github.
- Make a PR for your branch.
- Review and merge the PR from Player 1. Fix any merge conflicts.
- After both Pull Requests have been merged, pull the
main
branch from Github.
Part 2
Switch roles. This time, Player 2 is the owner of the repo and will add Player 1 as a collaborator.
Player 2 has the following responsibilies:
- Create a repository titled
FavoriteMovies
. - Add a file that holds a list of everyone’s favorite movies.
- Commit and push the main branch to Github.
- Add Player 1 as a collaborator.
- Create a new branch with your initials followed by the name of your favorite movie (e.g.
mm-social-network
). - In your branch, add a separate file with information on your favorite movie: name, year of release, characters, why it is your favorite movie, etc.
- Add your name and the name of your favorite movie to the list.
- Commit and push your branch to Github.
- Make a PR for your branch.
- Review and merge the PR from Player 1. Fix any merge conflicts.
- After both Pull Requests have been merged, pull the
main
branch from Github.
Player 1 has the following responsibilies:
- Accept the invitation from Player 2.
- Create a new branch with your initials followed by the name of your favorite movie (e.g.
rt-black-panther
). - In your branch, add a separate file with information on your favorite movie: name, year of release, characters, why it is your favorite movie, etc.
- Add your name and the name of your favorite movie to the list.
- Commit and push your branch to Github.
- Make a PR for your branch.
- Review and merge the PR from Player 2. Fix any merge conflicts.
- After both Pull Requests have been merged, pull the
main
branch from Github.