What is a version control system? Git explained in simple words

What is a version control system? Git explained in simple words

This article is intended primarily for non-technical IT founders. I'm explaining important terms from the technical side of the software development world in simple words.

As the name implies, the version control system is intended to control the versions of software.?

I will try to explain it using a painting as an example. Suppose you have drawn a landscape.

Альтернативный текст для этого изображения не предоставлен

Now you want to add a house in the foreground. What options do you have?

  • Option #1 is to take an existing landscape and add a house to it.?But then you would not have the original landscape.
  • Option #2 is to copy the landscape and add a house to the copy. In this case, you would still have both the original landscape and the option with the house.

Suppose you choose the second option.

Now you have two versions of this picture - with and without the house.

Альтернативный текст для этого изображения не предоставлен

Now, for example, if you need to replace the house with a tree, you can copy the original version (without the house) and just draw the tree. In the case of the first option, you would have to erase the house to draw a tree in its place.

Альтернативный текст для этого изображения не предоставлен
If we compare painting to software development, some initial code can be thought of as a landscape and each new feature can be compared to a new element in the picture, such as a house or a tree.

A version control system (VCS) is used to keep the history of modifications and to manage different versions of the software. At the moment, the most popular VCS is Git.?

What are the main features of Git?

Branching

One of the main features offered by Git is Branching. We inherit two branches from one parent branch?(making two copies of the original Landscape) to add our features.

Git branching


Merging

Git also allows you to merge branches together. The result will be a picture in which the house and the tree are both present at the same time.

Git merging

The importance of Git is hard to overestimate, especially for team-based work. Imagine having a different artist working on each piece of the overall painting. But it's crucial that once combined, they all look good - with the right lighting, shadows, in the right places in the picture, standing on the ground, and not hanging in the air.?

To achieve this, each of the participants in the project will inherit their branch from the main one and will work on the desired functionality in their copy of the painting.

It's important to understand that there is the main repository and its local copies.

Checkout

The process for a new developer starts with checkout. Each team member makes a local copy. This process is triggered by the checkout command. Every team member works with his/her local copy.

Commit

When a feature is finished, a commit is performed - the changes are committed to the version control system. At this point, only the local copy is updated. If a developer wants to push his changes into the main repository (his branch), he does a push - that way his changes will be stored in the main repository and become available to the other team members.

Usually, the most important moment is to merge the changes into a single branch, which becomes the release version of the software.

Conflict

What to do if a car is already drawn in the place where a house is supposed to be?

Such a situation is called a conflict and requires actions from the developer. The solution is individual in each case.?Drawing a parallel with paintings, you can move the car or draw a garage for the car, or even leave only one object.

Pull Request

Finally, the process of making changes to the painting itself can be different. In large projects, we don't want everyone to be able to add their own elements to the final picture. That is why there is a mechanism called Pull Request. After the changes are made, the developer makes a Pull Request.

This request is checked by the team member with appropriate permissions and approved or returned to the developer who worked on it originally. The approved Pull Request is merged with the main program code. So, despite the teamwork, the process is not chaotic and there is a leader responsible for the common vision and checking when adding new features.

Where is the code stored?

I mentioned that there is centralized code storage while the developers make local copies for themselves. Where is the code stored? Typically, you will use one of the popular services such as Github, Gitlab, and Bitbucket. All of them offer many additional features on top of the basic Git functionality.?

Conclusion

A version control system is a powerful and necessary tool in any modern software development team. I have tried to explain the main features that Git offers using a painting as an example.

If (suddenly) the team you are going to entrust to the development of your project does not use Git in every project, I'd strongly recommend looking for a different service provider.

Michael Ferrara

?????Trusted IT Solutions Consultant | Technology | Science | Life | Author, Tech Topics | Goal: Give, Teach & Share | Featured Analyst on InformationWorth | TechBullion | CIO Grid | Small Biz Digest | GoDaddy

1 年

Valerian, thanks for sharing!

回复

要查看或添加评论,请登录

Valerian Valkin的更多文章

社区洞察

其他会员也浏览了