class: center, middle, inverse, title-slide .title[ # Introduction to GitHub and GitHub Actions ] .subtitle[ ## Exercise 1: Creating a new GitHub repository ] .author[ ###
Pedro Henrique P. Braga
(Concordia University)
Katherine Hébert
(Université de Sherbrooke)
] .institute[ ### 4th QCBS R Symposium
QCBS R Workshop Series
] .date[ ### 2022-06-21
Use arrow keys to navigate. Press
H
for help.
] --- class: middle # Exercise 1: Creating a new GitHub repository --- ## Step 1: Getting started with GitHub and GitHub Desktop. For this exercise, you will need a GitHub account. If you do not already have a GitHub account, please create one at [github.com/join](https://github.com/join). We will also be using the GitHub Desktop application to demonstrate tasks. If you are new to GitHub, we recommend downloading and installing GitHub Desktop ([desktop.github.com](https://desktop.github.com/)) to follow along with the exercise instructions. --- ## Step 2: Create a new repository. Open GitHub Desktop, and go to the menu bar. <img src="imgs/exercise01/ex1_01.png" width="75%" style="display: block; margin: auto;" /> --- ## Step 2: Create a new repository. .pull-left[ Make sure you check the option to "Initialize this repository with a README". It is good practice to also add a gitignore file and a [license](https://choosealicense.com/) when you create a repository. ] .pull-right[ <img src="imgs/exercise01/ex1_02.png" width="75%" style="display: block; margin: auto;" /> ] --- ## Step 2: Create a new repository. .pull-left-35[ You've created your repository on your local computer! Now, we want to publish the repository to GitHub. ] .pull-right-65[ <img src="imgs/exercise01/ex1_03.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Step 2: Create a new repository. .pull-left-35[ You can uncheck the option to keep the repository private, if you want. OK, now it's ready to publish! ] .pull-right-65[ <img src="imgs/exercise01/ex1_05.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Step 2: Create a new repository. .pull-left-35[ You've just create a new GitHub repository! __Congratulations!__ The rightmost tab has now changed to "Fetch origin". This tells you that your local repository is linked with the remote repository. Fetching the origin means you can _fetch_ (or _pull_) any changes on the remote repository, to update your local version. ] .pull-right-65[ <img src="imgs/exercise01/ex1_06.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Step 3: Change a document in your repository. Now, let's change a file in our repository to see how GitHub works. Navigate to the folder you created as a new repository. You can see that we have a gitignore file, as well as a license, and a README. <img src="imgs/exercise01/ex1_07.png" width="75%" style="display: block; margin: auto;" /> --- ## Step 3: Change a document in your repository. .pull-left-35[ Open the README in your favourite text editor. It is pretty empty - let's add something to it! ] .pull-right-65[ <img src="imgs/exercise01/ex1_08.png" width="60%" style="display: block; margin: auto;" /> ] --- ## Step 3: Change a document in your repository. .pull-left-35[ Open the README in your favourite text editor. It is pretty empty - let's add something to it! OK, now __save__ the README file! ] .pull-right-65[ <img src="imgs/exercise01/ex1_09.png" width="60%" style="display: block; margin: auto;" /> ] --- ## Step 3: Change a document in your repository. .pull-left-35[ Go back to GitHub Desktop, to take a look at the change you've made in your files. The highlighted green line shows that you have made an _addition_ to your file. This seems like a good place to make a commit! ] .pull-right-65[ <img src="imgs/exercise01/ex1_10.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Step 4: Commit and push this change to the web. .pull-left-35[ Whenever you commit a change, you should add an informative message that describes the changes you've made. Here, we've made a pretty small change, so we can keep the message simple: "add some information". Looks good! Let's click on __"Commit to main"__. ] .pull-right-65[ <img src="imgs/exercise01/ex1_11.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Step 4: Commit and push this change to the web. .pull-left-35[ Now that we've made a commit, we need to push it to the remote. The rightmost tab shows that we can __Push__ 1 commit to the origin. That's what we want to do! ] .pull-right-65[ <img src="imgs/exercise01/ex1_12.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Step 4: Commit and push this change to the web. .pull-left-35[ If we navigate to the repository on github.com, we can see that the changes have been pushed to the remote. ] .pull-right-65[ <img src="imgs/exercise01/ex1_13.png" width="90%" style="display: block; margin: auto;" /> ] --- class: middle, center, inverse # Exercise 1: Complete! ## Congratulations!