Interaction with GitHub

Struggeling with the setup of GitHub?

If we can support you to setup GitHub, get in touch with us via Email and we will schedule a call for a walk through.

Step 1: Set up a GitHub Personal Access Token

Here are the step-by-step instructions to set up a GitHub personal access token:

Important

Treat your access tokens like passwords and keep them secure (e.g. a password managing software).

  1. Log in to your GitHub account.
  2. Click on your profile picture in the top-right corner of the page.
  3. Select “Settings” from the dropdown menu.
  4. In the left sidebar, click on “Developer settings”.
  5. Click on “Personal access tokens”.
  6. Click on “Tokens (classic)”.
  7. Click on “Generate new token” and from the dropdown menu select “Generate new token (classic)”.
  8. In the “Note” field, give your token the name: GITHUB_PAT
  9. Under Expiration, select “No expiration”
  10. Under “Select scopes”, select: repo, workflow, user
  11. Click on “Generate token”.
  12. Your personal access token will be displayed on the screen. Copy it and store it in a safe place.

Remember to treat your access tokens like passwords and keep them secure (e.g. a password manager software).

Step 2: Clone a repository

  1. Open github.com in your browser.
  2. Navigate to the GitHub organisation for the course.
  3. Find the repository md-01-assignments-USERNAME that ends with your GitHub username, and open it.
  4. Click on the green “Code” button.
  5. Copy the HTTPS URL to your clipboard.
  6. Open the ds4owd workspace on posit.cloud
  7. Click New Project > New Project from Git Repository
  8. Paste the HTTPS URL from GitHub into the “URL of your Git Repository” field.
  9. Wait until the project is deployed
  10. Continue with the next step

Step 3: Introduce yourself to git

  1. In Posit Cloud, open the md-01-assignments-USERNAME project that ends with your GitHub username.
  2. Open the git-configuration.qmd file from the bottom right window of RStudio.
  3. Edit the code chunk under “Git configuration details” and replace the placeholders with your name and email address (these will be the details that git will use to identify you when you commit changes to the repository)
  4. Render the document
  5. Continue with the next step
library(usethis)

# Replace Your Name and Your Email with your details. Do not delete the quotes "".
use_git_config(user.name = "Your Name", user.email = "Your Email")

Step 4: Commit and push your changes

  1. Navigate to the Git pane in the top-right window of RStudio
  2. Check the box next to the git-configuration.qmd file to stage it for commit
  3. Click on the “Commit” button
  4. Enter a commit message in the “Commit message” field
  5. Click on the “Commit” button$
  6. Click on the “Push” button
  7. Enter your GitHub username and GitHub Personal Access Token (PAT) in the “Username” and “Password” fields
Do not use your GitHub password

You need to enter the GitHub Personal Access Token (PAT) you created in Step 1 to push your changes back to GitHub.

Step 5: Open an issue on GitHub

  1. Open github.com in your browser.
  2. Navigate to the GitHub organisation for the course.
  3. Find the repository md-01-assignments that ends with your GitHub username.
  4. Click on the “Issues” tab.
  5. Click on the green “New issue” button.
  6. In the “Title” field write: “Completed module 1 assignments”.
  7. In the “Leave a comment” field, tag the course instructors @larnsce @mianzg @sskorik01