+ - 0:00:00
Notes for current slide
Notes for next slide

Lab 07 Pre-Work: CS631

Making a Site in the Tada!-verse
Part Deux: Connecting to GitHub

Alison Hill

1 / 19

First:

Build a site with blogdown

2 / 19

First:

Build a site with blogdown

NOW!:

Push your blogdown site to GitHub

2 / 19

First:

Build a site with blogdown

NOW!:

Push your blogdown site to GitHub

Next up in Lab 07:

Making a shareable site

2 / 19

Pre-work

This slide deck will lead you through the necessary sections of Happy Git with R to connect RStudio with your GitHub account.

We are going to assume:

βœ… Chapter 5: Register a GitHub account

βœ… Chapter 6: Install or upgrade R and RStudio

4 / 19

Chapter 7: Install Git

Key commands in terminal:

which git
git --version
5 / 19

Chapter 8: Introduce yourself to Git

Key commands in terminal:

git config --global user.name 'apreshill'
git config --global user.email 'apresstats@gmail.com'
git config --global --list

Obviously change the user name and email to your own.

6 / 19

Skip Chapter 9

7 / 19

Chapter 10: Connect to GitHub

Do all of this chapter!

8 / 19

Chapter 11: Cache credentials for HTTPS

Do all of this chapter! (make sure you get through 11.3)

9 / 19

Chapter 12: Set up keys for SSH

Optional.

10 / 19

Chapter 13: Connect RStudio to Git and GitHub

REQUIRED: Do all of this chapter!

11 / 19

Chapter 14: Detect Git from RStudio

Note: "This often β€œjust works”, so this page is aimed at people who have reason to suspect they have a problem."

12 / 19

Hurrah!

You made it this far!

πŸŽ‰πŸŽ‰πŸŽ‰

Open up your R project file for your blogdown site made in Lab 06.

13 / 19

Existing project, GitHub last

Now read and do all of this chapter with your blogdown site, since we already made the project and want to now connect it to GitHub. See next slide...

Generally, I don't recommend this workflow! IRL I try to do:

14 / 19

18.2: Make or verify a Git repo

We'll add GitHub to our existing project, using Chapter 18 from Happy Git with R. Scroll down to (note this is now in your R console, not terminal):

install.packages("usethis")
usethis::use_git()

It should say that a restart of RStudio is required, type in "absolutely"

When it restarts, you should see the Git pane in RStudio. Don't forget this step in terminal from your project's working directory:

git init
15 / 19

18.3: Stage and commit

Follow instructions to stage and commit.

16 / 19

18.4: Skip

17 / 19

18.5: Make and connect a GitHub repo

As the local repo, use your blogdown R project. Now is a great time to edit your .gitignore file before you push your local repo to a remote. Here is my file for a blogdown site:

.Rproj.user
.Rhistory
.RData
.Ruserdata
blogdown
.DS_Store # if a windows user, Thumbs.db instead
public/ # if using Netlify
18 / 19

Great job!

You are done with Lab 7 pre-work!

19 / 19

First:

Build a site with blogdown

2 / 19
Paused

Help

Keyboard shortcuts

↑, ←, Pg Up, k Go to previous slide
↓, β†’, Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow