Tutorial 2

This tutorial will focus on Git + GitHub practice

Git + GitHub

  1. Create a github repository from github.com

  2. clone it down to your computer

  3. Create/Edit the README file and write a short definition for the following commands:

    • git branch
    • git switch
    • git log --oneline --graph --all
  4. add/commit/push your definitions to your github repository

Branches and Pull Requests (PRs)

  1. Create a new branch (does not matter what name you give it)

  2. In the new branch define the following terms:

    • branch
    • pull request
  3. Push your branch up to github and create a pull request

  4. Make a comment in your own pull request

  5. Merge your pull request into main

  6. Update your local main branch

Extra: Merge Conflicts

Let’s create a PR with a merge conflict

  1. Create a new branch from main, edit the readme file, at the top and define the follow terms

    • git add
    • git commit
  2. Push this branch and create a PR, but DO NOT merge it

  3. On your local machine, go back to your main branch

  4. Create yet another branch from main (you should not be on your previous branch)

  5. At the top of your readme file define the following terms

    • git push ...
    • git pull ...
  6. add/commit/push your branch

  7. Create another PR from your second branch

  8. Try to merge both branches now, you should see a merge conflict when you try to merge the 2nd branch