Chapter 6 Git and Github

A collection of files associated with a single project is in git-speak called a “repository” or “repo”.

Depending on your project, there may already be one or more repos on Github that you will work on. The next step is to copy (“clone”) this remote repo to your local machine.

  • Clone your course repo on Github to a new R Studio project on your local machine.
    • Navigate to the course website on Github. Select your repo.
    • Click on the green button labeled “Code”. Copy the URL.
    • In the R Studio window, from the pull-down menu in the upper-right corner, select New Project..., Version Control, Git. Paste the URL into the dialog box labeled Repository URL.
    • Optional: Change the name of the project folder, and the location of this folder on your local directory tree.
    • Click on Create Project. The files from your remote repo should be copied to your local machine in a new folder with the name you chose.

6.1 Version control: what and why

6.2 How git works

6.2.1 The .gitignore file

6.3 Git in R Studio

6.4 Github

6.4.1 Using personal tokens to access Github

Github is phasing out the use of passwords for authorizations.

---- Forwarded Message -----
From: GitHub <noreply@github.com>
To: Arthur Small <asmall@virginia.edu>
Sent: Sunday, February 21, 2021, 6:20:58 AM EST
Subject: [GitHub] Deprecation Notice

Hi @arthursmalliii,

You recently used a password to access the repository at uva-eng-time-series-sp21/coronato-nicholas with git using git/2.30.0.

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.

Thanks,
The GitHub Team

Instead, you must create a personal access token. See the Github documentation. ## The Cooper Center Organization on Github

6.5 Best practices