Skip to content

sib-swiss/git-training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version control with Git

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.


Setting-up your environment 🐣

  • 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).

Course material 📚

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

Course slides

Exercise instructions

Exercise instructions are best viewed in a web browser. Simply click on the link below to display them.

Exercise material

Please download the following .zip files and decompress them on your local machine.

Exercise solutions

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:

Useful references and tutorials 🔮


Course schedule ⏳

  • Day 1 and 2: 9h00 - 17h30.
  • 1 hour lunch break, usually 12h00 - 13h00.
  • 15 minutes breaks in each half-day session.


Course Description 🦉

Overview

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:

Day 1: first steps with Git

  • Brief introduction to version control systems and Git.
  • Git basics: creating a Git repository and making commits.
  • Git concepts: commits, the HEAD pointer 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.

Day 2: Git advanced topics

  • Rewriting history: interactive rebase, git reset and commit amending.
  • The detached HEAD state explained.
  • The Git stash.
  • Git tags: label important commits.
  • GitHub: creating new projects, adding users and collaborating with them.

Optional modules

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.

Audience

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.

ECTS credits

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.


Course prerequisites 🌅

Knowledge/competencies

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.

Technical

  • 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.

Acknowledgments and funding 💸

Funding

  • 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).

About

SIB Git course material

Resources

Stars

Watchers

Forks

Packages

No packages published