• Home
  • About
  • Schedule
  • Sessions
  • Exercises
  • Code of Conduct

Contents

  • This session
  • Learning objectives
  • recipes project
    • Optional:
  • Exercises
    • Connect to remote repositories using SSH
    • Upload your local repository to a remote repository
    • Private collaboration on default branch (main or master)
    • Private collaboration with pull requests (using GitHub Flow)
    • Clone and sync your repository
  • 🚀 Bonus exercises
    • Add a README.md
  • Slides
  • Cheatsheet

Integration with GitHub / GitLab

Session 6

Starts at:

14:00

Slides Chapter: Remotes - Introduction

This session

In this session, you will work on the following tasks:

  1. Reading: Read the chapter(s) ?meta:chapter in the Version Control Book.
  2. Implementation: Try out the commands in the chapter.
  3. Exercises: Work on the exercises for the recipes project.

As always:

  1. Try out the commands of this session and play around with them.
  2. Check whether you have achieved the learning objectives.
  3. Ask questions!
  4. Let’s git started!

Learning objectives

At the end of this session, you should have achieved the following learning objectives:

đź’ˇ You can create a remote repository.
đź’ˇ You can connect your local Git repository to a remote repository service like GitHub or GitLab.
đź’ˇ You can pull and push changes to and from a remote repository.
đź’ˇ You can clone a repository from a remote repository.

recipes project

At the end of this session, you should have accomplished the following:

  1. You created a GitHub account.
  2. You connected your GitHub account to your local Git using SSH.
  3. You created a new private(!) GitHub repository.
  4. You uploaded (i.e., “pushed”) the default branch of your recipes repository to GitHub.

Collaboration Option 1/2 (Basic / Advanced):

  1. You invited a partner from the course as a collaborator to your recipes on GitHub.
  2. You collaborated on a shared project by adding and committing changes to your partner’s repository.

Collaboration Option 3 (Alternative):

  1. You clone your own repository to a different location on your computer.
  2. Stage and commit changes in the repository in this new location.
  3. Push the changes to GitHub and pull them in the original repository location on your computer.

Optional:

  1. You created a short README.md file in your repository.

Please keep the recipes folder! We will continue to use it in the following sessions.

Exercises

Connect to remote repositories using SSH

  1. Generate an SSH key.
  2. Copy the SSH key to your clipboard.
  3. Add the SSH key to the remote repository (for example, GitHub or GitLab).

Upload your local repository to a remote repository

  1. Create an empty repository on the remote repository hosting platform, for example GitHub or GitLab. Make sure to not initialize the repository with any files!
  2. If needed, navigate to your project repository using the command line.
  3. Set the remote URL of your local repository to your remote repository.
  4. Push the changes on your default branch (main or master) to your remote repository.

Private collaboration on default branch (main or master)

  1. Add your exercise partner as a collaborator to your recipes repository on GitHub.
  2. Clone your partner’s repository.
  3. Add a new recipe to your collaborator’s recipes.txt (if you are unsure where to add it, ask your collaborator!).
  4. Add and commit the changes.
  5. Push the changes to the remote repository.
  6. Pull your partner’s changes into your repository.

Private collaboration with pull requests (using GitHub Flow)

  1. If not done already, add your exercise partner as a collaborator to your recipes repository on GitHub.
  2. Clone your partner’s repository (if not already cloned).
  3. Create a new branch in your collaborator’s repository.
  4. Add a new recipe to your collaborator’s recipes.txt (if you are unsure where to add it, ask your collaborator!).
  5. Add and commit the changes.
  6. Push the changes on the new branch to the remote repository.
  7. Create a Pull Request (on GitLab: Merge Request).
  8. Review the Pull Request that your collaborator made in your repository.
  9. 🚀 Optional: Add additional changes on the branch pushed by your collaborator.
  10. Merge the pull request into your repository.

Clone and sync your repository

  1. Move to a location on your computer where you want to clone a repository.
  2. Clone your remote repository to a different location on your computer.
  3. Create a new branch and add a recipe to recipes.txt in the cloned repository.
  4. Commit the changes and push them to GitHub.
  5. Pull the changes into the repository at the original location.
  6. Delete your newly cloned repository.

🚀 Bonus exercises

Add a README.md

  1. Find the option to create a new file on your remote repository in the browser.
  2. Name the file README.md, add a brief description of your recipes repository (e.g., what kind of recipes it contains and who it belongs to), and provide a commit message.
  3. 🚀 Optional: Play around with Markdown syntax.
  4. Save the README.md file to the repository.
  5. Pull the changes to your local repository.

Slides

NoteHow can I download the slides as a PDF file?

To export the slides to PDF, do the following:

  1. Toggle into Print View using the E key (or using the Navigation Menu).
  2. Open the in-browser print dialog (CTRL/CMD+P).
  3. Change the Destination setting to Save as PDF.
  4. Change the Layout to Landscape.
  5. Change the Margins to None.
  6. Enable the Background graphics option.
  7. Click Save.

Note: This feature has been confirmed to work in Google Chrome, Chromium as well as in Firefox.

These instructions were copied from the Quarto documentation (MIT License) and slightly modified.

Cheatsheet

Command Description
git remote Manages remote repositories
git clone Creates a local copy of a repository
git pull Fetches and merges the latest changes from a remote repository into the current branch
git fetch Updates remote tracking branches
git push Uploads local commits to a remote repository

© 2026 Dr. Lennart Wittkuhn

 

License: CC BY 4.0