What is git


Git is an open source distributed version control system for agile and efficient handling of any small or large project.

1. What is version control

The main function of version control is to track file changes. It faithfully records when, who changed what content of the file and other information.

  Each time a file is changed, the version number of the file will increase.

Another important function of version control is parallel development.

  Software development is often multi person collaborative work. Version control can effectively solve the problems of version synchronization and development communication between different developers, and improve the efficiency of collaborative development.

2. What is version control system

  Version control system is a system that records the content changes of one or several documents so that the revision of a specific version can be consulted in the future.

It can save revisions of all files of the project code.

A file can be traced back to the previous version, and even the whole project can be traced back to a certain point in time in the past.

Can be edited collaboratively

You can compare the change details of the file to find out who modified which place in the end, so as to find out the cause of the strange problem and who reported a functional defect when.

Even if you change and delete the files in the whole project, you can easily return to the original state. However, the additional workload is minimal.

3. Centralized / distributed version control system

Let’s talk about the centralized version control system. The version library is stored in the central server. When working, you use your own computer, so you should first obtain the latest version from the central server, then start working, finish your work, and then push your work to the central server. The central server is like a library. If you want to change a book, you must first borrow it from the library, then go home and change it yourself. After changing it, you can put it back into the library.
The distributed version control system has no “central server” at all. Everyone’s computer has a complete version library. In this way, you don’t need to be connected to the Internet when you work, because the version library is on your own computer. Since everyone has a complete version library on their computer, how can multiple people cooperate? For example, if you change file a on your own computer and your colleague also changes file a on his computer, you can see each other’s changes by pushing your changes to each other.

Compared with the centralized version control system, the security of the distributed version control system is much higher, because everyone’s computer has a complete version library. It doesn’t matter if someone’s computer breaks down. Just copy one from others. If there is a problem with the central server of the centralized version control system, everyone can’t work.


When actually using the distributed version control system, it is rare to push the revision of the version library on the computers between the two people, because you may not be in the same LAN and the two computers cannot access each other, or your colleague may be ill today and his computer has not been turned on at all. Therefore, the distributed version control system usually has a computer that acts as a “central server”, but the role of this server is only to facilitate the “exchange” of everyone’s modifications. Without it, everyone also works, but it is inconvenient to exchange modifications.


Recommended Today

Redis featured Q & A

Redis data type type brief introduction characteristic scene String (string) Binary security It can contain any data, such as JPG pictures or serialized objects. One key can store up to 512M It can be used to do the simplest data. It can cache a simple string or a JSON format string. The implementation of redis […]