Git

2021-11-29

Version control

Version control in software development consists in recording all changes in the source code with the help of a version control system (VCS), a collection of software tools which manage versioning and collaboration in software development.

Version control allows to track all changes in a software system, to manage different development branches, to organize the collaboration of developers. In the case of research software, version control is becoming an indispensible tool to maintain Good Scientific Practice.

Centralized version control systems

Centralized version control systems like subversion (svn) work based on the client-server priciple. Developers check out working copies from a central server, and commit the changes back to that server after work has been finished.

Distributed version control systems

Distributed version control systems like git and mercurial are organized after the peer-to-peer principle. Instead of a working copy containing only a current version, users maintain clones of repositories, each of them containing the full history of the code. While it is possible to emulate the centralized model with this approach, the additional flexibility of this model has many advantages.

Git

Git was intiated by Linus Torvalds and as of now (2021) became the de-facto standard for source code management systems.


from xkcd

Git from the command line

Its origin as a tool for hardcore coders brings along a command line interface which is not easy to learn. Here are some resources besides the git homepagee with a number of external resources:

For collaborative development, it is worth to dig down the concept of branches.

Graphical user interfaces to git

In order to avoid or to minimize the interaction with git via the command line, graphical user interface tools are available. A good quality criterion for choosing such a tool is its ability to visualize the underlying DAG.

Git interaction from editing environments

Modern editors and editing environments like Visual Studio Code have a git extension supporting basic workflow.

Repository hosting and collaboration platforms

At the current stage, the decentralized model of development is to a significant extent thwarted by the availability of platforms like github and gitlab which in addition to hosting provide important additional features like Continous Integration (server based automatic software tests), issue discussions, easy support for standard workflows, wiki pages and more.

These platforms introduced the useful concept of pull requests aka merge requests.