Forks and Branches using the GitHub website
+In this section we will be using the GitHub.com website and demonstrate that you do not need to be a programmer to use version control and edit files on GitHub, nor using branches
+If you have not already created a GitHub username, please do so now:
+-
+
- GitHub: https://github.com +
- Follow optional advice on choosing your username +
As a Team of two
+-
+
- Help each other, everyone is bringing different skills! Talk it out! +
- Listen to each other; avoid judgment and solutioneering. +
- Have fun! +
Prompt
+We want to log the information about people’s favorite dessert using a repository.
+Setup
+Person 1 (owner):
+-
+
- Create a repository using the following these instructions steps 1-6 +
-
+
- Edit the
README.md
to: +-
+
- Click on pen at the top of the
README.md
file
+
+ - Click on pen at the top of the
-
+
- Replace the title (first line starting with
#
) with something better! MaybeFavorite Desserts
+ - Add your name and your favorite dessert below the title: e.g.
- Julien: crepes
+
You should now have a README similar to this:
+::include_graphics("img/github-readme_desserts.png") knitr
Forks
+Person 2: Create a Fork
+-
+
- Ask your teammate to Slack you the link to the repository +
- Create a Fork by clicking on the Fork button on the top right view of your repository homepage +
-
+
On your Fork, start editing the
README.md
+Add your name and your favorite dessert below your teammate entry: e.g.
- Sophia: chocolate
+Add a descriptive commit message
+
::include_graphics("img/github-commit.png") knitr
-
+
- Commit your changes +
-
+
- Create a pull request to merge those changes to the main repository using these instructions +
Person 1:
+-
+
- Go to your repository and merge the PR +
+
Branches
+Person 1: add a file
+Download this csv file about your favorite desserts to your computer
+-
+
- Just drag and drop it on the Github web page of your repository to upload it +
- Add a short message about the file: e.g.
Adding dessert csv
& hitCommit changes
+ - Your file has been uploaded. Click on the filename to see it! +
You should have something similar to this repo: https://github.com/brunj7/favorite-desserts/blob/master/favorite_desserts.csv
+Now you want to collaborate more closely and do not wan your teammate to have to create a fork and be able to work directly on your repository
+-
+
- Add Person 2 as a collaborator following these instructions +
Person 2: Create a branch
+-
+
- Check your email or Github Notifications to accept the invitation +
- Go to the repository website (link is provided in the invitation) +
- Create a new branch named after your first name +
::include_graphics("img/github-create_branch.png") knitr
-
+
- Edit the csv file directly on GitHub to add your favorite dessert to it +
- Create a Pull Request (PR) to merge you branch back to main +
- Assign person 1 as a reviewer (instructions) +
Person 1: Merge the branch
+-
+
- Review PR +
- Merge and close PR +