The article directories
-
- What is Git?
- Ii. The differences between centralized and distributed version control systems:
- 3. Choose github or GitLab?
- Four, summary
What is Git?
Git is a version control system.
Version control is a system used to record changes to the contents of one or more files, so that we can check the changes to a particular version.
In the past, without version control, we used to name projects in our project root directory like this:
Project_v1, project_v1.1, project_v2, and so on. In this way, we record the changes made to different versions of our projects. Sometimes, we also record the additions, modifications, and deletions of projects in different versions.
This operation is very complicated, sometimes also may be due to some non-human factors resulting in the loss of files such accidents.
With version control, you don’t have to do anything manual, and you don’t have to worry about losing files. You can go back to any point in history.
The early version control systems include SVN, CVS, etc. They are centralized version control systems, which have a single centralized management server to store the revised versions of all files, and the collaborative developers connect to this server through the client to retrieve the latest files or submit updates.
Here’s a picture from the Internet to show how they work:
Git is a distributed version control system. Git has become popular with more and more developers because of the advantages of distribution.
Ii. The differences between centralized and distributed version control systems:
Centralized version control system, the repository is concentrated in the central server, at work, using your own computer, so, we first need to pull the latest version from the central server, the network updates, and then began to work, such as work is done, to submit their work to the central server, namely online submission. Here to borrow a metaphor from Liao Xuefeng teacher, the central server is like a library, you want to change one of the books, you must first borrow the book from the library, and then change, change, and then put back to the library.
One of the biggest problems with centralized version control systems is that they must be connected to the Internet to work, so it is a headache to use centralized version control systems when the network environment is poor.
The concept of distributed version control system without a central server, we use the relevant client extraction is not only the latest file, but the code warehouse full mirror, equivalent to every computer is a complete version of the library, in this case, any server fails to work, can use any local repository to restore image. And, even in the case of poor network environment, do not worry, because the version library is on the local computer, single machine rollback, only when the submission of network, that is, single machine update + network submission.
Personal Summary:
(1). The local repository under the distributed version control system contains the code base and the history base, and the version history can be viewed locally.
(2). The historical repository under the centralized version control system exists in the central repository, and every comparison and submission code must be connected to the central repository.
(3). If a Git repository that acts as a central repository fails in multi-developer development, any developer can create a new central repository at any time and then synchronize to restore the central repository.
Here’s a picture from the Internet to show how they work:
3. Choose github or GitLab?
Git is a Version Control System (VCS), and Github is an online Git-based code hosting service.
Github and GitLab are based on the development of Git code management software, to achieve code management.
Therefore, how to use Git to operate Github is the same as using Git to operate Gitlab.
The biggest difference between Github and GitLab is that Github charges for selecting new projects as private! However, gitLab does not need to charge for selecting new projects as private, so the selection principle is as follows:
1.1 If the code written by an individual is not important, it can be shown to everyone. It doesn’t matter which one you choose.
1.2 If the code written by the individual is a little level and do not want others to see it, then use Gitlab. The main reason is that GitLab supports private warehouses for free, while Github charges for them.
1.1 If the code written by an individual is powerful and of commercial value, and does not want to be seen by others, and is afraid of code data leakage, it is necessary to choose GITLab, because GITLab can build the server of the company/individual to store data safely.
2. If the code is developed by the company team, you must only choose GitLab and set up the company’s personal GitLab service to ensure data security.
Four, summary
First, Git is a distributed version management tool, and the other three are websites.
Second, Github versus GitLab versus Gitee
(1) Personal use of Github, after all, more popular;
(2) The company uses GITLab, free private warehouse and free confidentiality;
(3) GITee, GITee is a git-based code hosting service launched by OSChina. The only advantage is that the access speed of Github in China is slow, and gitee is better.