Exercise 2
GitHub Collaboration Quest
The goal of this quest is to learn how to collaborate on a GitHub repository with others. You'll be creating a small bash script, and submitting your changes for your group to review. Details as follows:
- Form groups of 2-3 people
- Directly on the GitHub website, fork the repository at https://github.com/ds-grundlagen/collab-quest
- Find the "Fork" button on the top right of the page
- This will automatically create personal copy of the repository in your GitHub account
- Then when you make changes, you can push them to your own copy, and later request to merge them into the original repository
- Clone the forked repository to your local machine and open it as a new window in VS Code
- If you are using the browser version of VS Code, you must first
cd /workspaces
and clone it there.cd
into thecollab-quest
folder and then runcode .
to open it in a new VS Code window.
- If you are using the browser version of VS Code, you must first
- Create a new branch with a descriptive name
- Write a small python or bash script of your choosing into the
scripts
directory- The script can do anything at all, just make sure to add comments into the code to explain what it should do
- Add one mistake somewhere in your script so that it doesn't achieve the desired goal
- Your teammate(s) will need to fix the mistake later
- You can use VS Code or
nano
to edit the file
- Add a Markdown file to the
docs
directory explaining your script- Name it
script-name.md
wherescript-name
is the name of your script - Write some instructions on how to run it and what it does
- Name it
- Using the command line or VS Code, commit your changes and push them to your forked repository
- Now onto the GitHub side of things...
- Create a pull request from your branch to the communal (ds-grundlagen) repository
- Select one teammate as a reviewer for your pull request
- Your teammate(s) will need to review your changes
- They should find the mistake you made, and explain in the pull request why it's wrong
- They can even propose a fix for the mistake in the pull request if they want!
- Once the pull request is approved, merge it into the original repository
- You just made your first Pull Request! Celebrate your success! 🎉
Some cute ideas for scripts
Feel free to use google or LLMs to find fun/useful built-in bash commands to use in your script. Just try to make sure you understand what each command does and why you're using it!
- A script that greets the user
- A script that prints the current date and time
- A script that does some kind of math calculation