Version control is the management of changes to programs or documents so that you can easily see who made what changes, exactly what was changed, when it was changed, and quickly go back to any particular revision. It is particularly useful when several people are working on the same project, but even for one-person programming projects the benefits of using version control are significant.
Git is a popular distributed version control system. 'Distributed' means that every person working on the project has a complete copy of the history on their local computer. This makes it easy to work offline and also to collaborate with lots of different groups of people working in different ways. No central server or infrastructure is required to use git, just a copy of the program. Having said that, many projects find it useful to have a central git repository and so the University provides a git repository service at https://git.csx.cam.ac.uk/ . This provides free public and private repositories with fine grained access control to groups in the University. There are also external sites such as GitHub which provide free public repositories to anyone who signs up.
Getting started with git
- Get git installed on your computer if it isn't already.
- Managed Linux machines and clusters come with it pre-installed
- Managed Windows machines can easily have it added by selecting it at https://apps.ch.cam.ac.uk/wpkg/
- Managed Macs need the Xcode package, which can be installed by selecting it at https://apps.ch.cam.ac.uk/wpkg/ . This includes git.
- For personal machines see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- Read http://git-scm.com/book . Chapters 2 and 3 will get you started.
- If you want a central repository for your project at https://git.csx.cam.ac.uk please contact the Computer Officers to get that set up.
Subversion is a centralized version control system where code can be worked on anywhere, but changes are checked in to a single central server which holds the whole history of the project. The Department of Chemistry provides a Subversion server that any member of the department can use. We recommend new projects use git instead of subversion as git is more flexible.