Tutorial 2
This tutorial will focus on Git + GitHub practice
Git + GitHub
Create a github repository from github.com
cloneit down to your computerCreate/Edit the
READMEfile and write a short definition for the following commands:git branchgit switchgit log --oneline --graph --all
add/commit/pushyour definitions to your github repository
Branches and Pull Requests (PRs)
Create a new branch (does not matter what name you give it)
In the new branch define the following terms:
- branch
- pull request
Push your branch up to github and create a pull request
Make a comment in your own pull request
Merge your pull request into main
Update your local main branch
Extra: Merge Conflicts
Let’s create a PR with a merge conflict
Create a new branch from main, edit the readme file, at the top and define the follow terms
git addgit commit
Push this branch and create a PR, but DO NOT merge it
On your local machine, go back to your main branch
Create yet another branch from main (you should not be on your previous branch)
At the top of your readme file define the following terms
git push ...git pull ...
add/commit/pushyour branchCreate another PR from your second branch
Try to merge both branches now, you should see a merge conflict when you try to merge the 2nd branch