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")
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).
- Log in to your GitHub account.
- Click on your profile picture in the top-right corner of the page.
- Select “Settings” from the dropdown menu.
- In the left sidebar, click on “Developer settings”.
- Click on “Personal access tokens”.
- Click on “Tokens (classic)”.
- Click on “Generate new token” and from the dropdown menu select “Generate new token (classic)”.
- In the “Note” field, give your token the name: GITHUB_PAT
- Under Expiration, select “No expiration”
- Under “Select scopes”, select: repo, workflow, user
- Click on “Generate token”.
- 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
- Open github.com in your browser.
- Navigate to the GitHub organisation for the course.
- Find the repository md-01-assignments-USERNAME that ends with your GitHub username, and open it.
- Click on the green “Code” button.
- Copy the HTTPS URL to your clipboard.
- Open the ds4owd workspace on posit.cloud
- Click New Project > New Project from Git Repository
- Paste the HTTPS URL from GitHub into the “URL of your Git Repository” field.
- Wait until the project is deployed
- Continue with the next step
Step 3: Introduce yourself to git
- In Posit Cloud, open the md-01-assignments-USERNAME project that ends with your GitHub username.
- Open the git-configuration.qmd file from the bottom right window of RStudio.
- 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)
- Render the document
- Continue with the next step
Step 4: Commit and push your changes
- Navigate to the Git pane in the top-right window of RStudio
- Check the box next to the git-configuration.qmd file to stage it for commit
- Click on the “Commit” button
- Enter a commit message in the “Commit message” field
- Click on the “Commit” button$
- Click on the “Push” button
- 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
- Open github.com in your browser.
- Navigate to the GitHub organisation for the course.
- Find the repository md-01-assignments that ends with your GitHub username.
- Click on the “Issues” tab.
- Click on the green “New issue” button.
- In the “Title” field write: “Completed module 1 assignments”.
- In the “Leave a comment” field, tag the course instructors @larnsce @mianzg @sskorik01