Research Support Handbook

Version Control

Research Software

When you are working with data, writing a research publication, or writing software, it is important to keep track of the different versions of your work. With this, we mean that you keep track of what changes were made by whom, and that these changes can be reversed. Version control is important, because it helps you to fix mistakes and keep track of the work that you have done. There are several ways to do so:

You can find a more in-depth explanation of version control, with more examples, on the lesson page of The Carpentries.

Version control using version control software is mostly applied in the process of writing software. When you write research software, you want to keep track of what your software does, what changes you’ve made, and how these changes work. You also want to be able to return to a previous version if it turns out that one of the recent changes contained a mistake that means that the software no longer runs (correctly). Version control software allows you to do that. You could also use version control software for data or publication-writing, but it is not always as straightforward, for reasons explained below.

Git

Git is an example of the version control software that allows you to do the activities as described above. It is also the most-used version control software and therefore worthwhile to learn more about (for example, in this lesson from the Carpentries). With Git, you can create new versions of files by creating a ‘commit’. You can also go back in time to look at previous versions of files, and even reverse commits if necessary.

However, Git only works well for plain text files. These are files that end in extensions such as .txt, .md, .csv, .py, .R (there are more examples). It does not work well for other file types, such as .docx, .pdf or .xlsx. This is one of the reasons that Git is not commonly used for writing research publications: many researchers still use a text processor, such as Microsoft Word, for writing publications. Research data may also be saved in a file format for which Git does not work well.

Git platforms

When Git is run on an online platform, it can also be used to work remotely and to collaborate on files (and versions). Examples of such platforms are GitLab, GitHub and Bitbucket. This handbook, for example, is run on GitHub. There, editors and contributors can propose changes and keep building on each other’s work in a transparent and flexible manner. They can also go back to a previous version if something went wrong. Git platforms also usually include a way to resolve conflicts for files, which occur if two or more authors edited the same line of the same file simultaneously.

Learning more

There are many online resources that can help you to get started, or practise with version control:

Additionally, VU Amsterdam organises Software Carpentry courses, which include material on Git. In those courses, learning Git is combined with learning a programming language (Python or R). Would you like to know more about these workshop sessions, when they take place, and how you can attend? Check out LibCal for upcoming courses or get in touch with the RDM Support Desk.