当前位置:网站首页>Git + -- Code hosting in the history of version management

Git + -- Code hosting in the history of version management

2020-11-09 16:06:56 Huawei cloud developer community

Abstract : Choose a version management tool , It has been regarded as one of the necessary preparatory work for most enterprises , I believe that no developer has never heard of Git、SVN These tools . Today we're going to find the roots , The history of the development of version management .

Version management tools for software development , It's like a foundation to a building . This sentence is really appropriate , As the project gets bigger and bigger , More and more iterations , Version management tools are becoming more and more necessary .

With version management tools , We can browse... More easily 、 Check out historical versions and modification records of all development processes , No fear of making any changes , Because you can easily revert back to any version and know the reason for each change . You can even extract a single change from the history version , Put it in another version .

We can also use version management tools to modify and release different versions of software simultaneously , For example, the public beta version 、 Paid version and development version .

Choose a version management tool , It has been regarded as one of the necessary preparatory work for most enterprises , I believe that no developer has never heard of Git、SVN These tools .

Today we're going to find the roots , The history of the development of version management .

The history of version management

The chart above is a milestone in the history of version management , Let's divide it into four stages and talk about it in detail .

Prehistoric times Manual backup

Make a manual backup of the file before modifying it , Mark the name , This is the earliest version management .

The existence of manual backup , It shows that people need version management tools .

Farming Era Local version management tools

It's like the information blocking in the farming age , The first version management tools produced were called local version management tools , They are only given the ability to manage file versions on one server , There's no networking 、 Interactive features .

One of the most representative is 1982 By Purdue University of the United States Walter F. Tichy For the first time RCS(Revision Control System), It is better than Linux The release of the kernel is even earlier 9 year , It was originally intended to replace the world's first version management software (SCCS,1972, be used for Unix System ) Developed , At first RCS Only apply to Unix System , And then transplanted to Linux platform , It's even applied to Windows The platform's executable program .

Although they have been gradually forgotten by people , But after all, it is the Enlightenment of civilization in the field of version management , Now you can still find their source code from the major open source websites .

This era has also produced lock The concept of .

By locking, concurrent commit can be converted to sequential commit , It avoids that the same file is modified by more than one person at the same time , This was one of the first version control tools .

Age of Empires Centralized version management tools

Centralized version management tools are characterized by , Use a single server to keep all revisions of files , And people who work together connect to the server through the client , Download the latest code or update, submit , It's very much like the imperial era of centralization .

Its shortcomings are obvious , If the server hangs up , All the participants are out of work , And the results of the work may be lost .

But the emergence of centralized version management tools , Solved the first epic problem in the software industry —— Cross regional collaborative development .

There is a problem , There will be problem-solving heroes , A name Dick Grune The Dutch scientists in 1986 It developed a new product called CVS(Concurrent Versions System) Version management tools , This is the world's first centralized version management tool , Its original intention is to solve the inconvenience caused by cross regional collaborative development .

at that time Dick And two of his students are working on a compiler project , One student is a steady worker from nine to five , The other student's time was irregular , and Dick I can only do this project at night , Obviously, three people can't sit together to finish the project , So Dick stay RCS On the basis of the research and development of CVS.

CVS It was once the most popular version management software in the world , This has been going on for more than a decade , until 2000 By the Subversion(SVN) replaced .

SVN The purpose of the design is to create a better version management system to replace CVS, What's more interesting is that ,SVN In the early stage of R & D, we used CVS To manage its source code , And its main developers are CVS Bestsellers 《Open Source Development with CVS》 The author of Karl Fogel,Karl And his friends Jim Blandy stay CollabNet Funded by the company from 2000 year 2 Started research and development in January SVN, It was used 14 months , Finally in the 2001 year 8 month 31 No SVN Sure “ Self parasitism ” 了 , That is to say ,SVN Developers stop using CVS management SVN Source code , Start using SVN Instead of .

2010 year 1 month ,SVN It's official to be Apache Receive software foundation , And become a top project , Now (2020 year )SVN It's still the master of centralized version management tools .

SVN It is also the first use Branch Version management software of the system , Although it can only take all the file backup as a branch at first , But it also has a profound impact on the development of version management software in the future .

Branch , It can be understood as several sets of code in parallel in a project , They can be modified independently of each other , It can also be merged .

The Communist era Distributed version management tools

The biggest feature of distributed version management system is that the client does not only extract the latest version file snapshot from the server , It's a complete mirror of the warehouse , Including a complete history .

It can be understood in this way , Each client can actually be regarded as a central server .

The advantage of this mode of operation is not only when the central server is down 、 The data is corrupted , It can be recovered from any local client . You can also allow developers on airplanes 、 When programming cruise ships in this environment without network , First submit the work content to the local warehouse , When the network condition is available, it will be merged into the remote warehouse .

Distributed version management tools have basically eliminated the lock restrictions , Allow project participants to pull content from central repository to local repository at any time , Free development in local libraries , And only merge the changes that contribute to the project back to the central warehouse , This model has been used to the extreme in open source projects , Each participant feels like the owner of the project , The hosting platform for open source projects is like a mini Communist society .

Git It is the most advanced distributed version management system in the world ( Not one of them. ).

Git The birth is full of legend , The author is Li Dashen Linus Torvalds(Linux The father of ).

Linux The early days of open source projects , Volunteers around the world send source code files to Linus, Then from Linus I merged into by hand Linux Source code , This has been going on for more than a decade (1991~2002), The geometric increase of the code base makes Linus It's hard to continue to manage by hand , therefore Linus Chose a commercial version management system BitKeeper( The world's first distributed version management software , The only drawback was your !),BitKeeper The owner of BitMover The company is also humanitarian , to grant authorization Linux The community uses this version management system for free .

until 2005 year ,Linux A participant in the open source community cracked BitKeeper The agreement , By BitMover The company found , therefore BitMover The company is angry , Recovered Linux Free use of the community . Because of the spirit of open source Linus It's not like centralized CVS、SVN, I can't afford it BitKeeper, I have to start my own version management , And named it Git( English slang , A pain in the ass ), use Linus My own words :

About Git Specific research and development time of , Some say it's two weeks , Some people say it's two months , It's not accurate , Here's what the literature says Git Birth milestone .

· 2005 year 4 month 3 Japan , Start developing Git.

· 2005 year 4 month 6 Japan , Project release .

· 2005 year 4 month 7 Japan ,Git You can use it as your own version management tool .

· 2005 year 4 month 18 Japan , The first branch merges .

· 2005 year 4 month 29 Japan ,Git Has reached the performance of Linus The expected .

· 2005 year 6 month 16 Japan ,Linux The core 2.6.12 Release , At that time Git Already in maintenance Linux Core source code .

Then Git Rapidly becoming the world's most used version management software , Especially to 2008 year , The first associated open source community was born GitHub, Let more people understand and start to use Git.

The main founder of China's open source community 、 Mr. Zhuang Biao Wei, senior product manager of Huawei, is in 《 from 28 Ten thousand open source projects , What can we learn ?》 It is also mentioned many times in this article :“Git The dominance of , It has been unshakable ”.

Why are more people willing to choose Git?

that , Developers are willing to use Git As their version management tool , Just because it's from a famous family ? It's going to have some impact , You want to. , Born to manage Linux This operating system level project , What other projects can't be decided by it .

But what more intelligent developers are looking for is Git The characteristics of :

  • Distributed :

It's not going to put a lot of pressure on the server , Clients are also given more permissions , You can pull the full code 、 history , Work offline, etc .

  • Carry forward the use of branches :

Compared with SVN,Git Store branches in the form of snapshots , And use the pointer mode to complete the switch , This makes switching very fast , And allows the server and each client can have its own independent branch .

  • Resolve code conflicts locally :

Git It is not allowed to submit conflicting code segments to the server , It advocates developers to pull the difference code locally , And prompt developers to differ in location , Solve it locally 、 After the merger , And then submit it to the server , This is not only the best solution for developers , It also ensures the stability of the code version in the server .

  • It can be very simple , It can also be complicated :

Git Provides a rich set of instructions to implement almost all the functions you can think of , But it's very simple to start with , Novices just need to know clone、add、commit You can complete the basic workflow , Master can also use complex instruction combination to show real technology !

  • Free forever :

This is actually quite important .

Git There are also shortcomings. !

None is perfect , a slight blemish ,Git Although it is recognized as the king , But it's not without shortcomings , Let's see Git Second in the world SVN Comparison of .

function & characteristic GitSVN The running mode is distributed , Each client is a separate version library centralized , All versions are stored in the central server for offline work support , Code can be submitted to a local version library. It does not support , Everything needs to be connected to the central server branch snapshot Branch , Fast switching speed, full file Branch , Slow switching speed , The branch of processing concurrent memory 、 Local consolidation , Support multiple people and multiple versions to develop locks in parallel , The way to deal with concurrency is to avoid storing snapshots in concurrent historical versions , Multiple terminals , Economical and safe storage in the central server , Once damaged , It's hard to find the difficulty to use and easy to use 、 It's hard to master. The support for Chinese is excellent , Easy to use rights management is not perfect , Support granular level configuration permissions

You can see Git In terms of operation mechanism and specific function realization, it is slightly better , However, its bloodline with the spirit of open source determines its weakness in rights management ,Linux Yes Git The design is , Anyone can pull the code repository , And it's a full pull , It also includes the history of the warehouse and the historical version , This is a really cool setting for open source projects , But in business projects , Isn't this a Bug?

Hua Wei Yun CodeHub Service makes up for Git The shortcomings of

Many organizations appreciate Git excellent , At the same time, we found Git Weakness in access control , They have released many new products based on Git Code hosting platform for , It's like for Git Made armor , It is worth mentioning that Huawei cloud has built Managed code (CodeHub) platform .

This red armor , The precipitation of Huawei in the field of information security near 30 The exploration of , Let's take a look at CodeHub Currently known access control and security policies :

· use “ Tenant + user + User group + role ” The multi-dimensional model is used to control the permissions .

· Users need to go through HTTPS/SSH Communicate with cloud warehouse , Will use SSH Key Or warehouse user name and password for access authentication .

· All operations must have Token, Audit records of all key operations , Audit logs are persisted , It can be kept long enough , And can carry on the accurate backtracking .

· The user's managed files are stored encrypted .

· Support settings for protected branches .

· Provides multiple participation 、 Code merge evaluation component of scoring system .

Simply speaking ,CodeHub Make the user's read and write permissions controllable and configurable , It makes up for Git The last short board of .

CodeHub What else can the service do ?

↓↓↓↓↓~ Gateway to the seeker ~↓↓↓↓↓

·  Rich code templates

·  Customizable code submission rules

·  Code submission and project task status can be linked

·  Points system Code Review

·  Code submission automatically triggers DevOps Assembly line

·  Online code checking

·  In the browser Coding

·  Data analysis

·  Skip the grindstone , Try creating a warehouse directly ~

Rich code templates

Huawei cloud code hosting services are designed for different development languages 、 Constructing environment , Dozens of warehouse templates are preset , Developers can use templates to create repositories in the cloud , Achieve the effect of rapid initialization of R & D environment .

For students who are learning software development , It also provides a wealth of Demo Source code , Can be directly used to learn , Or to experience in DevCloud Medium DevOps The whole process .

Learn more about

in addition , Support users to share their own warehouse as templates .

Customizable code submission rules

Huawei cloud code hosting service supports setting different code submission rules for each warehouse , Ensure the code standardization of the central library , For the team quality construction escort .

Learn more about

Code submission and project task status can be linked

Huawei cloud code hosting service can change the code and work items in project management ( Demand list 、 Questionnaire ) Related to , The state of the work item is automatically changed .

in other words , Developers just need to submit code , The questionnaire can flow automatically , This greatly improves the efficiency of collaboration , Save developers from the complex workflow , Make it more focused on coding .

Learn more about

Points system Code Review

The value of code reviews is more than just brainstorming , avoid bug、 Improve code quality 、 Looking for better solutions , Through this process, each project participant can learn more about the business modules , At the same time, it can also achieve the purpose of personnel mutual preparation .

Huawei cloud code hosting service provides online credit system Code Review function , Project participants can score in the review 、 Comment on 、 Initiate discussion and other operations , The total integral can be used as a standard , After the team has reached a consensus , Then the next step of merging and branching can be carried out .

Record of review opinions , It also allows team members to understand the history of the project , It's easier to follow the code 、 Follow the record of submission and discussion to find out what happened at that time .

Learn more about

Code submission automatically triggers DevOps Assembly line

As Huawei cloud DevCloud One of the constituent services of , Code hosting services can be used as on the cloud DevOps The trigger uses .

Learn more about

Online code checking

Huawei cloud code hosting service will automatically identify the warehouse language , And generate the corresponding inspection report .

In the warehouse management management page, you can see the code health of the warehouse , Click to see the detailed code check report .

Learn more about

In the browser Coding

Huawei cloud code hosting service has built-in Cloud IDE function , Developers can use the browser Coding.

It greatly improves the response speed of developers to urgent tasks , Make agile development mode more handy .

Learn more about

Data analysis

Huawei cloud code hosting service provides multi-dimensional data analysis reports ( Code contribution Statistics 、 Warehouse language statistics 、 Submit statistics 、 Cangli submitted network diagram, etc ), Help warehouse managers understand the progress of R & D work .

Learn more about

If you are looking for a reliable version management platform , You might as well go to Huawei cloud code hosting (CodeHub) service Create a warehouse try ,5 The following use is free of charge ~

Click to follow , The first time to learn about Huawei's new cloud technology ~

版权声明
本文为[Huawei cloud developer community]所创,转载请带上原文链接,感谢