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

Contents

  • Session 2: Basics of the Command Line
    • Navigate the file system
    • Create files and folders
    • 🚀 Bonus exercises
    • Writing and opening files
    • Creating multiple files
    • Wildcards
    • Combining commands
  • Setup & Configuration of Git: Setup & Configuration of Git
    • Configure Git
  • Session 4: First steps with Git & Git Essentials
    • Initialize a Git repository
    • Add content and commit changes
    • Amend a commit
    • Create a .gitignore file
  • Session 5: Branches
    • Branches
    • 🚀 Bonus exercises
    • Create and resolve a merge conflict
  • Session 6: Integration with GitHub / GitLab
    • 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)
    • 🚀 Bonus exercises
    • Clone and sync your repository
    • Add a README.md
  • Session 7: Collaboration on GitHub / GitLab
    • “Public” collaboration with pull requests (using a fork and GitHub Flow)
    • Reviewing pull requests

Exercises

Session 2: Basics of the Command Line

Navigate the file system

Identify a folder on your computer where you (want to) keep course-related files. If you don’t have one, choose a suitable location in your file system.

  1. Navigate into the chosen location using the command line.
  2. Use the command line to display the path of your chosen folder. What is the output?

Create files and folders

  1. Within your chosen folder, create a new subfolder called recipes.
  2. Navigate into the recipes folder.
  3. Create a new text file called recipes.txt.
  4. Confirm that the file was created by listing the contents of the folder.
  5. Add the title “My Favorite Recipes” to recipes.txt. Which command or method did you use?

🚀 Bonus exercises

Writing and opening files

Add a first recipe to recipes.txt. Include at least a title and a short list of ingredients. Which command or method did you use?

Creating multiple files

Go back to your main course-related folder. Using the command line, create three new files: notes.txt, assignments.txt, and schedule.txt. Provide the command you used.

Wildcards

Use a wildcard pattern to list all .txt files in your folder. Which command did you use?

Combining commands

Imagine, that you are in a folder containing multiple text files with various extensions, including .txt, .md, and .docx. You want to move all the .txt files to a subfolder named text_files while keeping the other file types in the current directory. Write a series of command-line commands to accomplish this task, including creating the text_files subdirectory. Explain each step in your solution.

Setup & Configuration of Git: Setup & Configuration of Git

Configure Git

  1. If needed, navigate into the project folder using the command line.
  2. Set your Git username.
  3. Set your Git email address. This email address will appear in your Git history, so use an address you are comfortable sharing.
  4. Change the default name of the initial branch to main.
  5. 🚀 Optional: Change your default text editor.
  6. List the Git configuration settings.

Session 4: First steps with Git & Git Essentials

Initialize a Git repository

  1. If needed, navigate to the project folder using the command line.
  2. Initialize a new Git repository in the project folder.

Add content and commit changes

  1. Open recipes.txt (created in the command-line session) in a text editor.
  2. Add a short recipe entry (a title and a short list of ingredients — use any favorite or an intriguing AI-generated one).
  3. Stage the file.
  4. Commit the changes with a descriptive commit message.

🚀 Optional: Commit at least three additional recipe entries in recipes.txt.

Amend a commit

  1. If needed, navigate to the project repository using the command line.
  2. Add a new recipe to recipes.txt without a title, and commit the change.
  3. Now add a title to the recipe.
  4. Stage the change.
  5. Amend the previous commit to include the title change (without altering the commit message).
  6. Check the commit history to verify that the last commit message has not changed.

Create a .gitignore file

  1. If needed, navigate to the project repository using the command line.
  2. Add a file to your repository that you want to ignore, for example an image file like image.jpg.
  3. Check the state of your repository to confirm that Git noticed the added file.
  4. Create a .gitignore file.
  5. Add a pattern to the .gitignore file to ignore the file.
  6. Check the state of your repository again to confirm that Git now ignores the added file.
  7. Stage the changes in your repository.
  8. Commit the .gitignore file using a descriptive commit message.
  9. 🚀 All macOS users: Also let your repository ignore .DS_Store.

Session 5: Branches

Branches

  1. If needed, navigate to the project repository using the command line.
  2. Create a new branch with a descriptive name, e.g., add-pizza-recipe.
  3. Switch to the new branch.
  4. Add a new recipe to recipes.txt.
  5. Stage and commit the changes to recipes.txt on the new branch.
  6. View the contents of recipes.txt to verify your changes.
  7. Switch back to the default branch (main or master).
  8. View the contents of recipes.txt again to confirm that the changes do not exist on the default branch.
  9. Merge the new branch into your default branch.
  10. Delete the feature branch.
  11. View the contents of recipes.txt yet again to confirm that the changes have been merged into the default branch.

🚀 Bonus exercises

Create and resolve a merge conflict

  1. Deliberately create a merge conflict by making conflicting changes to the same section of recipes.txt on two separate branches (for example, change the same ingredient differently on each branch) and attempting to merge them. An example can be found in the branches chapter.
  2. Resolve the merge conflict.
  3. Delete the merged branch afterwards.

Session 6: Integration with GitHub / GitLab

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.

🚀 Bonus exercises

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.

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.

Session 7: Collaboration on GitHub / GitLab

“Public” collaboration with pull requests (using a fork and GitHub Flow)

  1. Find out what forking is.
  2. Fork the project repository of the course instructor or another course participant (ideally, someone who is not your collaborator from the previous exercise). If you can’t find a suitable partner’s repository, fork Lennart’s recipes repository as a fallback.
  3. Create an Issue in your new collaborator’s repository, indicating a recipe that you think is still missing.
  4. Repeat the steps from the exercise on collaboration with remote repositories using the forked repository:
    1. Clone the forked repository to a sensible location on your computer.
    2. If available, read the contributing guide of the repository before making any changes.
    3. Create a new branch and make one or multiple commits adding the recipe that you suggested in the Issue.
    4. Push your changes to the remote repository.
    5. Create a pull/merge request with your changes (hint: from the forked to the original repository) and refer to the Issue in your pull/merge request.

Find out about the contributing guidelines in Lennart’s repo and follow them when creating a new recipe.

Reviewing pull requests

  1. View any pull requests that are created in your recipes repository.
  2. Review the changes made by the contributor in the pull request. Check that the contributed recipe follows the format of existing recipes and any contributing guidelines.
  3. If needed, discuss additional changes with the contributor in the pull request.
  4. Close the pull request by merging the proposed changes.

© 2026 Dr. Lennart Wittkuhn

 

License: CC BY 4.0