The connection and difference between Git, GitHub and GitLab

1 The concept of version control

1.1 Why do you need version control?

      In the past, when version control was not used, we usually named the project in the root directory of our project like this: project_v1, project_v1.1, project_v2, etc. In this way, we recorded the changes of different versions of our project. A description will be written in the files of different versions to record the operations of adding, modifying and deleting items in this version. Such operations are very complicated, and sometimes there may be accidents such as file loss due to some non-human factors. With the version control system, we no longer need to manually perform some complicated operations, and we do not have to worry about the accident of file loss, you can just go back to a certain moment in the history.

1.2 The concept of version control

      Use version control to manage the design process of engineering blueprints in the field of engineering design. Version control can also be used to manage version iterations of code during IT development. A good version control tool should have the following functions:
      (1) Collaborate to modify
      the same file on the server side by multiple people in parallel.
      (2) Data backup
      not only saves the current status of directories and files, but also saves the historical status of every commit.
      (3) Version management
      should save the duplicated data when saving the file information of each version, so as to save storage space and improve operating efficiency.
      (4) Permission Control Permission control is performed
     on the people who participate in the development of
     the team. The code contributed by developers outside the team is reviewed- unique to Git.
      (5) Historical mechanism
     View the modified person, modified time, modified content, and log information. Restore local files to a certain historical state.
      (6) Branch management
      allows the development team to advance tasks simultaneously on multiple production lines during work, further improving efficiency.

1.3 Version control tools

     Version control systems are divided into the following two categories:

  • Centralized version control system
         Centralized version control system, the version library is stored centrally on the central server. When working, we use our own computer, so we first need to pull the latest version from the central server and then start working , Wait until the work is finished, and then submit your work to the central server. Borrowing an analogy from Teacher Liao Xuefeng here, the central server is like a library. If you want to change one of the books, you must first borrow the book from the library, then change it, and then put it back in the library .
         Disadvantages : One of the biggest problems with centralized version control systems is that they must be networked to work, so using centralized version control systems for relatively poor network environments is a headache.
    Centralized version control system
  • Distributed version control system
         Distributed version control system does not have the concept of a central server. We use the relevant client to extract not only the latest files, but the complete mirroring of the code warehouse, which is equivalent to everyone's computer. Version of the repository, in this way, any server that works together can be restored using any mirrored local repository. And, don't worry even when the network environment is poor, because the repository is on the local computer.
         The distributed version control system does not have the concept of a central server. We use relevant clients to extract not only the latest files, but the complete mirroring of the code warehouse, which is equivalent to everyone's computer is a complete version library If any server fails to work together, it can be recovered from any mirrored local warehouse. And, don't worry even when the network environment is poor, because the repository is on the local computer.
    Distributed version control system

2 What is Git?

2.1 Introduction to Git

     Git is a version control system, which is a type of distributed version control system. Official website address: git-The advantages of official website
Insert picture description here
     Git:

  •      Most operations are done locally, no internet connection required
  •      Integrity guarantee
  •      Add data whenever possible instead of deleting or modifying data
  •      Branch operation is very fast and smooth
  •      Fully compatible with Linux commands

2.1 Git installation

The following website has a detailed introduction, and there is also a detailed introduction in it, which is convenient for getting started quickly: Git-Book
Git-Book

3 Introduction to GitHub and GitLab

     GitHub and GitLab are web-based Git repository
     similarities : both provide a platform for sharing open source projects, providing development teams storage, sharing, centralized cloud storage sites publish and co-development projects.
     Differences : As an open source code base, GitHub has more than 9 million developer users. It is still the hottest open source project hosting platform. GitHub provides both public and private warehouses, but if you use a private warehouse, you need to pay.
     GitLab solves this problem, you can create a private free warehouse on it. GitLab gives the development team more control over their code repositories. Compared to GitHub , it has many features:

  • Allow free setting of warehouse permissions;
  • Allow users to choose to share part of a project's code;
  • Allow users to set project access rights to further improve security;
  • You can set the improvement progress of the team as a whole;
  • Through innersourcing, people who are not within the scope of permissions cannot access the resource; in
    summary , from the perspective of the privacy of the code, GitLab is a better choice. But for open source projects, GitHub is still the first choice for code hosting.

3 Reference articles

The connection and difference between Git, GitHub and GitLab

Published 34 original articles · praised 4 · 30,000+ views

Guess you like

Origin blog.csdn.net/leaeason/article/details/104907231