Using Git

Table of contents

Git is a very powerful and popular version control system, widely used by software projects to manage their codebase. It helps users to track and share their changes as they work on their project.

Git tracks how the text files in a project evolve by providing a history of all the changes made to the them. Every time changes are saved, Git creates what is known as a commit, representing the state of all project files at the point in time that the commit was created.

G-Cubed projects are built on a Git foundation. Git is used to manage the development of all G-Cubed software and all G-Cubed models. Specific research projects are simply new model development projects and they too benefit from being set up with a Git foundation.

`Github is a commercial website that hosts a staggering number of software development projects that also use Git for version control. G-Cubed uses Github to host its projects. At its core, this means that the central repository for all G-Cubed projects is hosted by Github. It also means that those projects benefit from all of the additional features provided by Github, including code review systems, issues tracking, project management, Wiki documentation, and so on.

Git is extremely powerful and that power implies a learning curve. To become an efficient contributor to G-Cubed projects, team members need a minimum level of understanding about how to use Git. Fortunately, the VS Code editor used for working with G-Cubed projects has great built-in support for Git that makes it easy to do the common Git operations. VS Code also has extensions like Git Graph that make it easy to visualise the state of a project. Git Graph is built into the devcontainers used for G-Cubed projects.

Ways to learn Git

It is often tempting to just get started and figure things out as you go. While this is possible with Git, it is not encouraged, even for small projects. There is a conceptual framework that needs to be understood before the various Git operations make sense. The following resources provide different ways of developing this understanding. It is worth exploring them until that conceptual framework is understood.

Github workflows

Git is all about making it ‘easy’ to collaborate across large teams all working on the same collection of text documents, supporting independent work, contribution sharing, and conflict resolution. Many different workflows have evolved as teams determine how they can best use Git for their own collaboration.

Github has documented a workflow that we also recommend for G-Cubed projects. It encourages particular patterns when using Git that quickly become familiar.