Welcome to the home page of the Version control with Git SIB course.
This two-day course provides a comprehensive overview of the Git version control system. Please see the course description section for details.
- Please complete the environment setup instructions before the start of the course.
- In particular, make sure to communicate us your GitHub user name at least 2 days before the start of the course via the course shared online document (link will be sent by email before the course).
Please note that the definitive course material (slides and exercises) will be made available on the first day of the course. Until then files do not necessarily correspond to their final version (but are in principle very close to it).
✨ Tip: to download the entire course material in one go, you can clone this repository by running the git command:
git clone https://github.com/sib-swiss/git-training.git- Day 1: First steps with Git
- Day 2: Git advanced topics
- Git commands: a summary of all commands seen during the course. Available as PDF document, and markdown for online viewing.
- Git optional modules. These are more specialized Git commands and features that go beyond the scope of the course and will not be covered in class but can be discussed upon request.
Exercise instructions are best viewed in a web browser. Simply click on the link below to display them.
- Day 1: exercises first steps
- Day 2: exercises advanced topics
- Optional modules (not covered in class):
Please download the following .zip files and decompress them on your local
machine.
- Day 1: exercises_first_steps.zip
- Day 2: exercises_advanced.zip
- Optional modules (not covered in class): exercises_optional_modules.zip
While the solutions to all exercises are provided, we encourage you to not look at the solutions too quickly. Try to solve the exercises without them, and remember that you can always ask the course instructors for help.
- Day 1: solutions are integrated in the exercise instructions.
- Day 2: solutions are integrated in the exercise instructions.
- Optional modules:
- Solutions CI/CD - solutions are integrated in the exercise instructions.
- Solutions submodules
- Solutions Git LFS
- Day 1 and 2: 9h00 - 17h30.
- 1 hour lunch break, usually 12h00 - 13h00.
- 15 minutes breaks in each half-day session.
Git is an open source version control system for tracking changes in code and other types of text documents. First released in 2005, Git has become the de-facto standard for version control, and is extensively used in both open source and commercial software development. Beyond software development, Git has also proven to be an essential tool in reproducible research - allowing to keep track of files such as data analysis scripts, pipelines, reports or more generally any text-based document.
This 2-days course gives a comprehensive overview of Git and its most useful commands, as well as an introduction to collaborative workflows using GitHub through both theory and practical exercises.
The course starts with the basics of Git - it is therefore suitable for people with no or little knowledge of Git - and will take participants all the way into more advanced territory such as editing the history of a Git repository. Emphasis is also put on collaborative workflows, which are actively practiced in some of the practical exercises.
Important: please note that this course focuses exclusively on using Git via command line. This knowledge is then easily transferrable to any GUI environment (e.g. VS Code, RStudio, etc.).
The course covers the following topics:
- Brief introduction to version control systems and Git.
- Git basics: creating a Git repository and making commits.
- Git concepts: commits, the
HEADpointer and the Git index. - Git branches: introduction to branched workflows and collaborative workflow examples.
- Branch management: merge, rebase and cherry-pick.
- Retrieving data from the Git database:
git checkout. - Working with remotes: collaborating with Git and GitHub.
- Rewriting history: interactive rebase, git reset and commit amending.
- The detached
HEADstate explained. - The Git stash.
- Git tags: label important commits.
- GitHub: creating new projects, adding users and collaborating with them.
This material is not formally presented during the course. It covers topics that can be useful in certain scenarios:
- GitHub Actions and GitLab CI/CD: writing automated pipelines.
- Git submodules: embed a Git repository as a subdirectory of another Git repo.
- Git LFS: versioning large files with Git.
This course is aimed at people who are interested in using a version control
system for collaborative work, or simply to keep track of modifications in
their scripts, files or code base.
This includes people working on code development, but also scientists
interested in improving the reproducibility of their data analyses by keeping
track of their scripts using version control.
Participants who wish to receive ECTS credits for the course can take an optional exam at the end of day 2 of the course. The SIB will recommend successful participants to receive 0.5 ECTS credits from their home institutions.
The course is focused on using Git in command line mode (no graphical user
interface). It is therefore
highly recommended to have some basic knowledge of the UNIX command line:
e.g. how to change directory or how to edit a file in a command line editor
such as vim/nano.
If you are not familiar with these UNIX fundamentals, we strongly recommend that you either:
- Follow an introductory UNIX course (e.g. the SIB "First Steps with UNIX" course - see upcoming training courses,
- Take an online tutorial such as this one before the start of the course.
- A Wi-Fi enabled laptop with a recent version of Git installed. Git is available on all major platforms and can be downloaded here.
- For online classes, you should also have a working microphone, as some exercises involve collaboration/communication with other participants.
- The development of this course has been funded by the Swiss State Secretariat for Education, Research and Innovation (SERI) trough the SIB Swiss Institute of Bioinformatics.
- Other funding sources include:
- European Union's Horizon Europe Framework Program (grant number 101080997).