I have no title, yet.

Git for Scientists

May 27, 2025

Welcome!

Meet the lecturer

Lars Schöbitz

Headshot of Lars Schöbitz

Learning objectives

By the end of this workshop, participants will be able to:

  1. Create and clone repositories, and explain the difference between cloning and forking a repository.

  2. Apply the standard Git workflow using RStudio IDE—including pull, stage, commit, and push changes to GitHub.

  3. Work with branches and pull requests by creating and managing development branches (using both RStudio and the terminal), submitting pull requests, and reviewing and commenting on others’ pull requests to facilitate code review and collaborative development.

Teaching strategy

  • Teaching Git on a “need to know” basis
  • Teaching only a very small subset of Git’s functionality
  • Creating a safe space for learning and getting support (use Element)
  • Focus on collaboration aspects of GitHub

Schedule

Time Module
10:00 - 10:15 GitHub for Collaboration
10:15 - 10:45 Create & Clone
10:45 - 11:00 Break
11:00 - 11:15 Clone & Branch
11:15 - 11:30 Pull Request & Merge
11:30 - 11:35 Publish
11:35 - 11:45 Wrap-up

Your turn

Think about the last time you published a written document:

  • Which tasks gave you joy?
  • Which tasks were challenging or frustrating?

Take some written notes.

02:00

GitHub for Collaboration

Read on: GitHub strategies

  1. Openscapes Champions Lesson Series. Lowndes, Butland, and Robinson (2024): https://openscapes.github.io/series/core-lessons/github/

  2. Excuse Me, Do You Have a Moment to Talk About Version Control? https://peerj.com/preprints/3159/

Create & Clone

Your turn

  • Open github.com
  • Navigate to your profile
  • When completed, place a yellow sticky note on your laptop

Now, follow along the screen and instructor.

01:00

Your turn

  1. Clone a GitHub repository of a fellow student (browse: github.com/username to fine the repository website)
  2. Open the repository in RStudio IDE
  3. Make a change the README.md file
  4. Save the file
  5. Stage, Commit & Push the changes
id username1 username2
1 Madliboom fdaguanno
2 TillRoost mag-wer
3 pacotvj99 louma3000
4 ellahenninger CamilleFournierDL
5 dheimgartner jineichen
6 vgeier rjalcock
7 Jonathan-Elkobi rainbow-train

What happens?

05:00

Read on: Fork and clone

Take a break

Please get up and move! Leave your emails alone.

This is the prompt generated by DALL-E 3 by OpenAI: A pixel art scene representing the concept of taking a break. The scene shows a serene outdoor setting with a clear blue sky. In the center, a small pixelated character is sitting comfortably on a bright green grassy hill, under the shade of a large, leafy tree. The character is depicted in a relaxed pose, perhaps sipping a warm beverage from a small cup. Nearby, a gentle stream flows, and a few fluffy white clouds drift in the sky. The overall mood of the image is peaceful and calming, emphasizing the tranquility of taking a break in nature.
15:00

Clone & Branch

Your turn

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

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

  3. Click on the repository name to open it.

  4. Click on the green “Code” button.

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

  6. Open the RStudio IDE on your laptop.

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

  8. Click on Version Control.

  9. Click on Git.

  10. Click on Browse… button.

  11. Use the folder structure you created in the pre-course work (e.g. ~/Documents/gitrepos/gh-org-gitforsci-cis)

  12. Paste the HTTPS URL from GitHub into the “Repository URL” field.

  13. Click on the “Create Project” button.

  14. Find the Files tab in the bottom right pane of RStudio.

Place the yellow sticky note on your laptop when you have completed the task.

05:00

Pull Request & Merge

Our turn

  • We will continue together with man-washinvestments-USERNAME where USERNAME is your GitHub
01:00

Publish

Our turn

  • We will continue together with man-washinvestments-USERNAME where USERNAME is your GitHub
01:00

GitHub Pages

  • GitHub Pages is a free service for hosting static websites. It is ideal for blogs, course or project websites, books, presentations, and personal hobby sites.

Minimal Example - Requirements

  • Landing site needs to be stored as index.qmd
  • The index.qmd needs to be stored in docs folder
  • Example works well for a report/article as a stand-alone page
  • Quarto provides a framework and examples for more complex websites: https://quarto.org/docs/websites/

Quarto websites

  • Websites are essentially format: html + a Quarto Project
  • But a website is different than format: html in that it has multiple pages
  • Websites can be your first exploration into Quarto Projects
  • Websites and books are very similar in that they associate multiple pages/resources into a connected resource

Learn more

Wrap-up

Wrap-up

  • Post your collected questions in the Element channel
  • Start your first project using Git & GitHub (already have a project? Read here)
  • Keep learning by doing (create PRs to yourself)
  • Share your knowledge with others (help them get started)

Thanks!

Slides created via revealjs and Quarto: https://quarto.org/docs/presentations/revealjs/

Access slides as PDF on GitHub

All material is licensed under Creative Commons Attribution Share Alike 4.0 International.

References

Lowndes, Julia Stewart, Stefanie Butland, and Erin Robinson. 2024. “Openscapes/Series: Openscapes Lesson Series V2024.11.0.” Zenodo. https://doi.org/10.5281/zenodo.14428503.