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

Contents

  • Objectives
  • Tasks
  • 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
  • Resources

Git: Remotes

Starts at:

Friday, 13:00

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.

Tasks

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

  1. Reading: Read the chapter(s) Remotes - Introduction in the Version Control Book.
  2. Implementation: Try out the commands in the chapter.
  3. Exercises: Work on the exercises.

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!

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 project repository on GitHub.
  2. Clone your partner’s repository.
  3. Add a new change to your collaborator’s project file (if you are unsure, where to add the entry, 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. Add your exercise partner as a collaborator to your project repository on GitHub.
  2. Clone your partner’s repository.
  3. Create a new branch in your collaborator’s repository.
  4. Add a new entry to your collaborator’s project file (e.g., .txt or .qmd (if you are unsure, where to add the entry, 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. Stage and commit changes in the new location (consider using a new branch).
  4. Push these new changes to GitHub.
  5. Pull the changes to the repository in 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, 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.

Here’s what the Chrome print dialog would look like with these settings enabled:

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

Resources

  • Version Control Book: Remotes – Introduction
  • GitHub Docs: About remote repositories
  • Understanding public key / private key concepts by Blake Smith
  • GitHub Docs: Generating a new SSH key

© 2026 Dr. Lennart Wittkuhn

 

License: CC BY 4.0