In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what are the advantages and disadvantages of git and SVN version control?" the content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the advantages and disadvantages of git and SVN version control?"
The difference between Git and SVN (1) SVN (centralized version management system)
Centralized version control systems have a single centrally managed server that holds revised versions of all files, while people who work together connect to the server through the client to retrieve the latest files or submit updates.
Subversion is a centralized version control system.
Benefits:
Everyone can see to some extent what other people in the project are doing.
The administrator can also easily control the permissions of each developer.
Disadvantages:
A single point of failure on the central server. If there is an hour of downtime, during that hour, no one will be able to submit updates, restore, compare, etc., and will not be able to work together.
If the disk of the central server fails and the backup is not made or not backed up in time, there is also a risk of data loss. The worst-case scenario is to completely lose all historical change records for the entire project, except for some snapshot data extracted by the client, but this is still a problem, and you can't guarantee that all the data has been extracted.
In principle, Subversion is only concerned with the specific differences in the contents of the file. Each time you record which files have been updated and what lines have been updated.
Many people believe that the centralized version control system is inadequate in terms of speed and performance. Later, based on the shortcomings of the centralized version control system, a distributed version control system was developed.
Summary of the characteristics of Subversion
Each version library has a unique URL (official address) from which each user gets the code and data.
To get code updates, you can only connect to this unique version library and synchronize to get the latest data.
Submission must have a network connection (non-local version library)
Submission requires authorization. If there is no write permission, the submission will fail.
Submission is not always successful. If someone else submits before you, you will be prompted to "change based on the outdated version, update before submitting". And so on.
Conflict resolution is a race for the speed of submission: those who are fast, submit first, and those who are slow, submit later, may encounter trouble in conflict resolution.
2) Git (distributed version Management system)
As shown in the following figure:
Take Git as an example:
Git is a distributed version control system. A big difference between the distributed version control system and the centralized version control system is that the server and client of the distributed version control system have a complete set of version libraries. Without the server, the client can still manage the version. And check the history and version comparison and other related operations, do not need to access the server, that is to say, the distributed control system can improve the efficiency of version management than the centralized control system.
Git records version history only concerned with whether the overall file data has changed, Git does not save the difference data before and after the changes in the content of the file.
So each time Git saves a complete snapshot of the project, it requires a relatively large amount of hard disk space.
The Git team did extreme compression of the code and ended up requiring not much more real space than SVN, but Git rollback was extremely fast.
In fact, Git is more like taking snapshots of changed files and recording them in a miniature file system. Each time an update is submitted, it goes through the fingerprint information of all the files, takes a snapshot of the file, and then saves an index that points to the snapshot. To improve performance, if there are no changes to the file, Git will not save it again, but will only attach to the last saved snapshot.
In the distributed version control system, the client not only takes the snapshot of the latest version of the file, but also mirrors the original code repository completely. In this way, any server used to work together fails and can be recovered later with any mirrored local repository. Such systems can be designated to interact with several different remote code repositories. Therefore, you can collaborate with people in different working groups on the same project, and you can set different collaboration processes according to your needs.
In addition, because Git keeps all the historical updates about the current project on the local disk, and most operations in Git only need to access local files and resources without networking, it is fast to process. With SVN, you can't do anything without the Internet or disconnecting VPN. But with Git, even if you are on a plane or train, you can happily submit updates frequently and upload them to a remote image repository when the network is available.
2. Advantages and disadvantages of SVN and Git (1) advantages and disadvantages of SVN
1) advantages:
Convenient management, clear logic, in line with the thinking habits of ordinary people.
It is easy to manage and the centralized server is more secure.
Code consistency is very high.
Suitable for the development of projects with a small number of developers.
2) disadvantages:
The server is under too much pressure, and the database capacity is soaring.
Must have a network environment, stand-alone can not achieve version control. That is, if you can't connect to the server and basically can't work, you can't commit, restore, compare, and so on.
Pay attention to avoid a single point of failure of the centralized server.
There is no direct contact between clients.
Not suitable for open source development (the number of developers is very large). However, the general centralized management has a very clear authority management mechanism (such as branch access restrictions), which can achieve hierarchical management, so as to solve the problem of a large number of developers.
(2) advantages and disadvantages of Git
1) advantages:
Suitable for distributed development, emphasizing individuals.
The pressure on public servers and the amount of data will not be too large.
Fast and flexible.
Conflicts can be easily resolved between any two developers.
Can work offline.
2) disadvantages:
The learning cycle is relatively long.
It's not in line with conventional thinking.
Code confidentiality is poor, once developers have cloned the entire library, they can fully disclose all code and version information.
Thank you for reading, the above is the content of "what are the advantages and disadvantages of git and SVN version control?" after the study of this article, I believe you have a deeper understanding of what is the difference between git and SVN version control, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.