Test your setup (1 of 3): Clone the setup repository

This is the first of three short steps that test whether your setup is complete and working. In this step, you accept your invitation to the GitHub organization and clone your personal setup repository into RStudio.

This step only works after you have received an email from GitHub

You can only complete this step once you have received the invitation email to the gitforsci-ghe organization, which I send after you complete the pre-course survey. No email yet? Confirm that you have completed the pre-course survey, check your spam folder, and then contact me by email: lschoebitz@ethz.ch

Step 1: Accept invitation from GitHub

  1. Open your email that you used to register for your GitHub account.
  2. Find the email from GitHub with the subject “[GitHub] @larnsce invited you to join the ‘gitforsci-ghe’ organization”.
  3. Click on “Join @gitforsci-ghe” link in the email to accept the invitation and work through the steps that follow in your browser to accept the invitation.

Step 2: Create a bookmark

  1. Open the landing page for the GitHub organization ‘gitforsci-ghe’: https://github.com/gitforsci-ghe

  1. Bookmark this page in your browser.

  1. Organize the bookmark into a folder called “gitforsci-ghe” or similar.

  1. Use this folder to add other bookmarks that are relevant for this workshop (e.g. the workshop website)

Step 3: Clone the setup repository

  1. Open the landing page for the GitHub organization ‘gitforsci-ghe’: https://github.com/gitforsci-ghe (try to use your bookmark)

  2. Navigate down the page to the section “Repositories” and use the search field to find the repository called setup-USERNAME where USERNAME is your GitHub username.

  1. Click on the repository name to open it.
No repository with your username?

Contact me by email if your repository is not there. I will create it for you.

  1. Click on the green “Code” button.

  1. Copy the HTTPS URL to your clipboard by clicking on the clipboard sign.

  1. Open the RStudio IDE on your laptop.
Note

I am working on MacOS, but the steps should be similar on Windows.

  1. Click on File > New Project in the top menu bar

  1. Click on Version Control.

  1. Click on Git.

  1. Click on Browse… button.

  1. Create a folder structure for Git repositories (e.g. ~/Documents/gitrepos/gh-org-gitforsci-ghe)
Folder structure for Git repositories and naming conventions

I highly recommend storing folders that are Git repositories separate from other folders. This will help you to keep track of your Git repositories and avoid confusion with other folders.

Create this directory structure locally on your laptop and not in folders that are synced with cloud storage (e.g. Google Drive, Dropbox, OneDrive, etc.).

In your directory structure, you can create a folder called gitrepos. Inside this folder, you can create subfolders for each GitHub organization you are working with (e.g. gh-org-gitforsci-ghe). A subfolder for your personal profile would be gh-rainbow-train. If you also work with GitLab or other Git hosting platforms, use the abbreviation for the platform in the folder name (e.g. gitrepos/gh-rainbow-train, gitrepos/gl-rainbow-train, etc.).

This strategy will help you to keep track of your Git repositories and the respective platforms and organisations they belong to.

  1. Paste the HTTPS URL from GitHub into the “Repository URL” field.
The “Project directory name” field

After you paste the URL, RStudio usually fills in the “Project directory name” field for you. If it stays empty, leave it empty and do not type anything. Creating the project works with an empty field.

  1. Click on the “Create Project” button.

  1. Find the Files tab in the bottom right pane of RStudio. You will see three numbered R scripts: 01-github-token.R, 02-git-configuration.R, and 03-workshop-packages.R. You will work through them in the next two steps.

Next step

Your repository is cloned and open in RStudio. Continue with Step 6b: Configure Git and push your first change.