.. at DTU biosustain and DTU bioengineering.
- Introduction to git (slides), see recording here
- Hands-on, focusing this time on
- working on a shared repository (per group, i.e. e.g. per table)
- creating and merging branches
- viewing and annotating collaborative work
- showing features of GitHub
If time allows - and maybe due to common errors - we will also cover:
- merge conflicts
- out-of-sync issues
The workshop will require you to have a GitHub account. Please open it here: github.com/join
ONLY one person per group has to do this.
Per group (e.g. table) create one repository on GitHub on one of the group members account or under the DTU biosustain organization.
- Use as template this repository from
github.com/enryH/notes_template. Follow the instructions described here or the demo-recording to use it.
Now you have a common repository you can share with each others. You can either work in a codespace (opening the repository in a virtual machine in the browser) or clone the repository to your local machine.
- we won't cover the website aspect of the template here, but I created a video on how to use the template for a website here (which is also linked in the repository's README).
Each of you create a branch, e.g. give it your name. Add a brief description of what you
are passionate about in a file called aboutme.md
in a folder with your name.
In order to commit this to the GitHub repository you have to do one of the two options:
- add all collaborators of your group to the repository (write access)
- create a fork on your GitHub account (you will be asked in VSCode if you want to do this)
You can also mix both approaches in your group to find out about the differences.
You can see how to commit changed files here (in one part of the notes template hands on recording)
On GitHub open a pull request to merge your branch to the main branch. We will explore together some features of the pull request website.
Hint: Use the extension Git Graph to visualize your branches and the history of your repository.
Switch back to the main
branch and get all the latest changes from your coworkers (pull).
Now, each create (again) a new branch (pick a unique new name) and create a the file name biosustain.md
.
In this file write a about what you think biosustain is about.
The first pull request will work fine. Everyone else has to deal with merge conflicts, as the same named file will be overwritten - and there is no clear way to say which version is the correct one or how to combine you changes.
- Hint: In your CodeSpace make sure to checkout the latest changes from the main branch before creating a new branch (pull on main).
Advanced!
We will explore how to resolve merge conflicts in VSCode's UI. This is advanced and you don't have to do this for now.