Version Control Systems

Use of Version Control and Repositories
Have you ever wished you could return to the state of your code just a few minutes/hours before you introduced some lines that break things? Have you ever made copies of your code like, project_old, project_old_1, project_old_2 ...etc. ? Have you ever shared or developed code through email with your collaborators back and forth? 

Developing code is an iterative process that can greatly benefit from maintaining a record of its evolution. Having access to a specific version of the code at different stages can be valuable for comparing the current code with past versions, identifying where a possible bug was introduced, reverting to a previous implementation, and collaborating transparently with others. Manually managing the history of code changes is inefficient and error-prone, so we use version control systems. In recent years, git has been the most commonly used version control system among scientists, but there are other options such as Mercurial, Subversion, and CVS.

Although it may seem time-consuming to adopt version control for a project, the time invested is likely to pay off in increased productivity and more efficient coding.

Projects are organised in repositories, which can live on a local computer but can also be synced with repositories hosted on platforms such as Gitlab, GitHub, and Bitbucket.

Using version control alone will not solve all problems, but following good practices such as giving meaningful commit messages and making shorter, more frequent commits can help realise the benefits. Note that the same procedures and workflows can also be used files beyond source code, e.g., input files, simulation data and so on.

When working in a team, implementing a collaborative development strategy is worth considering.

A useful resource to getting started and learning git can be found at the Software Carpentry ”version control with Git” lesson. A more advanced resource focused on collaborative version control by CodeRefinery can be helpful when working in a team. 

General development platforms
GitLab
GitHub

What the FZJ Software Guidelines say about Version Control Systems

Class 0 and higher
The use of a version control system is recommended.

Class 2 and higher
Version control systems and code repositories are used that contain or refer to all components of the software required for its use, and that are used for change management.

Example: Any changes to the source code are documented using Git.

Last Modified: 12.03.2025