What is version control?¶
Version control is a way of systematically recording changes to files (such as computer code and data files). This allows you to restore any previous version of a file. More importantly, this history of changes can be queried, and each set of changes can include additional information, such as who made the changes and an explanation of why the changes were made.
A core component of making great decisions is understanding the rationale behind previous decisions. If we don't understand how we got "here", we run the risk of making things much worse.
For academic research activities that involve data analysis or simulation modelling, some key uses of version control are:
-
You can use it as a log book, and capture a detailed and permanent record of every step of your research. This is extremely helpful for people — including you! — who want to understand and make use of your work.
-
You can collaborate with others in a systematic way, ensuring that everyone has access to the most recent files and data, and review everyone's contributions.
-
You can inspect the changes made over a period of interest (e.g., "What have I done in the last week?").
-
You can identify when a specific change occurred, and what other changes were made at the same time (e.g., "What changes did I make that affected this output figure?").
In this book we will focus on the Git version control system, which is used by popular online platforms such as GitHub, GitLab, and Bitbucket.