In this lab, we will learn how to use GitHub for collaborative development.
Goal: by the end of this lab, you will be able to push and pull from GitHub.
Use the Projects tab in RStudio to switch to your Mini-Project #2 project.
First, we want to verify that our local
git repository is properly connected to the remote
git repository host on GitHub. To do this, we’re going to use the Terminal tab. This is next to the Console tab in the bottom right. Note that you will need the latest version of RStudio in order to use the Terminal tab. If you don’t have a Terminal tab, you should upgrade your RStudio by clicking on
Help -> Check for Updates.
To see the remote repository, type in the Terminal:
git remote -v
You should see the URL to your group’s repository. If not, you’ll have to change your remote.
Next, we want to make sure that our local repository is synced with what is on GitHub. To do this, click the Pull (downarrow) button under the Git tab in the upper right pane.
Alternatively, you can do this in the terminal by typing:
You do NOT need to do both!
Make any change to the
mp2.Rmd document. Save the document
Stage your modified files by checking the box next to the blue
M in the Git tab.
Commit your changes by clicking on the
Commit button. Write an informative commit message, and commit your changes.
Just to be safe, pull again to bring down any upstream changes.
Push your commit to GitHub.
Please respond to the following prompt on Slack in the
Prompt: What further questions do you have about using GitHub?