Skip to content

Git — What is it and what is it good for?

What is git

Git is a Version Control System (VCS). In software development, a VCS is used to manage changes in source code.

Other VCS

Git is one of several VCS, but can be considered as the most popular. Other VCS include:

Benefits of a VCS

There are 3 main benefits to using a VCS like git:

  1. Keep track of who wrote what code and when
  2. Maintain multiple versions of a software application
  3. Save all source code

Keep track of who wrote what and when

With a VCS, each and every change to the source code is recorded, along with the date it was made and who made it.

Maintain multiple versions of a software application

Let's assume that v1.0 of our application is already deployed to production, and we are working on v1.1, which is not yet ready to be deployed.

A user reports a critical bug, which the product owner decides must be fixed. We can extract the source code at v1.0, i.e. exactly the same as the code currently running in production, fix the bug, and redeploy the app at v1.0.1. During that time, the code at v1.1 remains unimpacted, and we can go back to working on v1.1. We can also include the bug fix from v1.0.1 into v1.1 if we wish.

To continue our example above, let's assume that we have now deployed v1.1 to production, but right away we notice a critical bug. We can easily revert the production release to the last known version, ie v1.0.1.

Save all source code

Source code is valuable. Even source code in an //unfinished// state must be preserved. A VCS allows us to do this.

For example, let's assume we have to implement a feature. This may be the work of several days, and at any time before completion, the code is //unfinished//, ie it does not fully implement the feature's requirements, or possibly it breaks the app, etc. Still, you don't want to risk losing several hours, or days, of work because your computer crashes, or your laptop is stolen.

Instead, you can save your work in the VCS without impacting the code used in production, or written by other developers.

Git servers

Git is open source, and is designed as a decentralized VCS. Anyone can create a git repository anywhere, even on their own computer.

However, for practical considerations (safeguarding the source code, managing access control and permissions, etc.) most people use one of 3 git service providers:

Gitlab provides a self-hosted version of their software.

Further reading