In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what is the difference between git and svn, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Differences: 1, SVN is a centralized version control system, while Git is a distributed version control system; 2, SVN is stored in accordance with the original file, the volume is larger, while Git is stored in accordance with metadata, the size is very small; 3, the branch operation of Git will not affect other developers, while SVN will.
Introduction to svn and git SVN (centralized version control system)
SVN, short for Subversion, is an open source version control system that supports most common operating systems. As an open source version control system, Subversion manages data that changes over time. The data is placed in a central data archive (repository). This archive is very much like an ordinary file server, but it remembers every change of the file. In this way, you can restore the file to the old version, or browse the change history of the file. Subversion is a general-purpose system that can be used to manage any type of file, including program source code.
Work flow
The core of centralized code management is the server. Before starting a new day's work, all developers must get the code from the server, then develop, and finally resolve the conflict and submit. All version information is placed on the server. Developers can basically be said to be unable to work without the server. The following examples are given:
Start a new day's work:
Download the latest code for the project group from the server.
Go into your own branch, do your work, and submit code to the server's own branch every other hour (a lot of people have this habit. Because sometimes I change the code back and forth, and finally I want to revert to the version of the previous hour, or see what code I changed the previous hour.
It's almost time to get off work, merge your own branches into the main branch of the server, and the day's work is completed and reflected to the server.
SVN is a centralized version control system.
This approach brings many benefits, especially when compared to the old-fashioned local VCS. Now, 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.
There are two sides to things, there are good and bad. The most obvious disadvantage of doing so is the single point of failure of 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.
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.
GIT (distributed version control system)
Git is a free, open source distributed version control system for agile and efficient handling of any small or large project
Git is an open source distributed version control system for efficient and high-speed version management of projects ranging from very small to very large. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.
The biggest difference between distributed and centralized is that developers can submit it locally, and each developer copies a complete Git repository on the local machine through git clone.
Functional characteristics of Git
From the general developer's point of view, git has the following features:
Clone the complete Git repository (including code and version information) from the server to a stand-alone machine.
Create branches and modify code on your own machine according to different development purposes.
Submit the code on the branch you created on the stand-alone.
Merge branches on a single machine.
Fetch the latest version of the code on the server and merge it with your own main branch.
Generate a patch (patch) and send the patch to the main developer.
Looking at the feedback from the main developer, if the main developer finds that there is a conflict between two general developers (conflicts that they can work together to resolve), they will be asked to resolve the conflict first and then submitted by one of them. If the main developer can solve it on his own, or if there is no conflict, pass.
In general, developers can use the pull command to resolve conflicts between developers, and then submit patches to the main developer after resolving the conflicts.
From the point of view of the master developer (assuming that the master developer does not need to develop code), git has the following features:
Check email or other ways to check the submission status of general developers.
Patch and resolve the conflict (you can resolve it yourself, or you can ask developers to resolve it and resubmit it later, and if it's an open source project, decide which patches are useful and which don't).
Submit the results to the public server and notify all developers.
Git is a distributed version control system.
Since its birth in 2005, Git has become more and more mature and easy to use, while still retaining the goals set in the early days. It is very fast and extremely suitable for managing large projects, and it also has an incredible nonlinear branch management system that can cope with a variety of complex project development needs.
Unlike SVN, Git records version history only about whether the file data as a whole has changed. Git does not save data about differences between before and after changes in the contents of the file. 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 and takes a snapshot of the file, and then saves an index that points to the snapshot. To improve performance, if the file does not change, Git will not save it again, but will only attach the last saved snapshot.
Characteristics of Git
The version library for each clone in Git is equal. You can create your own version library from any clone of the version library, and your version library can also be provided to others as a source, as long as you want.
Each extraction operation of Git is actually a full backup of the code repository. The submission is done entirely locally, without authorization, your version library is up to you, and the submission will always be successful.
Even changes based on the old version can be successfully committed, and the commit creates a new branch based on the old version.
The submission of Git will not be interrupted until your work is completely satisfied, PUSH gives or others PULL your version library, merging will occur in the process of PULL and PUSH, and conflicts that cannot be resolved automatically will prompt you to do so manually.
Conflict resolution is no longer a submission contest like SVN, but a merger and conflict resolution only when needed.
The difference between svn and git
SVN is a centralized version control system, there is an imprecise analogy: SVN = version control + backup server SVN feels a bit like an archive repository, supporting parallel reading and writing of files, supporting versioned management of code, functions including take out, import, update, branch, rename, restore, merge and so on.
Git is a distributed version control system, operation commands include: clone,pull,push,branch, merge, push,rebase,Git is good at version management of program code.
Like SVN, GIT has its own centralized version library or server. However, GIT is more likely to be used in a distributed mode, where each developer clones their own version library on their own machine after chect out code from the central version library / server.
It can be said that if you are stuck in a place where you can't connect to the Internet, like on a plane, basement, elevator, etc., you can still submit documents, view historical versions, create project branches, and so on. To some people, this doesn't seem to be of much use, but when you suddenly run into an environment without the Internet, it will solve your big problem.
While Git is stored according to metadata, the volume is very small; SVN is stored according to the original file, the volume is larger.
GIT stores content as metadata, while SVN all resource control systems hide file meta-information in a folder like .svn, .cvs, etc.
If you compare the size of the .git directory with that of .svn, you will find that there is a big difference between them. Because the .git directory is a cloned version library on your machine, it has everything on the central version library, such as tags, branches, version records, etc.
Branches are nothing special in SVN, just another directory in the version library. If you want to know if a branch has been merged, you need to manually run the command svn propget svn:mergeinfo like this to confirm that the code has been merged.
However, dealing with the branches of GIT is quite simple and interesting. You can quickly switch between several branches from the same working directory. You can easily find unmerged branches, and you can merge these files easily and quickly.
GIT does not have a global version number, and SVN has by far the biggest feature that GIT lacks compared to SVN. As you know, the version number of SVN is actually a snapshot of the source code at any corresponding time. I think it's the biggest breakthrough in evolution from CVS to SVN. Because GIT and SVN are conceptually different, I don't know what features correspond to them in GIT. If you have any clues, please give them in the comments and share with you.
GIT's content integrity is better than SVN:GIT 's content storage using the SHA-1 hash algorithm. This ensures the integrity of the code content and reduces damage to the version library in the event of disk failures and network problems.
Influence of branching operation
The branching operation of Git will not affect other developers; SVN will, and everyone will have the same branch as you do when you create a new branch.
Advantages and disadvantages of svn and git advantages and disadvantages of SVN
SVN has good support for Chinese, easy to operate and no difficulty to use. Artists, product personnel, testers and implementers can all use it easily. The utility model has the advantages of unified interface, perfect function and convenient operation.
Advantages and disadvantages of Git
For differential version management of program source code, the code base takes up very little space. Easy branching management of the code. Does not support Chinese, the graphical interface support is poor, the use is difficult. It is not easy to promote.
Differences in the scope of application of svn and git
It is applicable to different objects. Git is suitable for developers involved in open source projects. Because of their high level, they care more about efficiency than ease of use. SVN, on the other hand, is suitable for ordinary corporate development teams. It's easier to use.
It is used in different situations. Git is suitable for the development of a single project with multiple development roles through Internet, and SVN is suitable for the development of multiple parallel projects coordinated by project managers within the enterprise.
Rights management policies are different. Git does not have strict rights management control, as long as you have an account, you can export, import code, and even perform fallback operations. SVN has strict permission management, which can be used to control the permissions of a subdirectory by group or individual. Distinguish between read and write permissions. More stringent, fallback operations are not supported. Make sure the code can always be tracked.
The scope of use of branch is different. In Git, you can only branch the entire warehouse, and once deleted, it cannot be restored. In SVN, branch can target any subdirectory, which is essentially a copy operation. So, you can build a lot of hierarchical branch and delete it when you don't need it, and you can just use the old SVN version of checkout when you need it later.
Based on the third point, Git is suitable for simple software projects, typically some open source projects, such as Linux kernel, busybox and so on. On the contrary, SVN is good at multi-project management. For example, you can store a bsp/ design document / file system / application / automated compilation script for a mobile project in a SVN repository, or a file system for five mobile projects in a SVN. N (number of items) * m (number of components) warehouses must be established in git. Only a maximum of n or m is needed in SVN.
Git uses 128bit ID as the version number, and checkout indicates which branch it is, while SVN uses an incremental sequence number as the globally unique version number, which is more concise and easy to understand. Although you can use gittag to create some textual aliases, it is only for special versions.
Traceability, the typical development process of git is to set up branches, develop them, submit them to local master, and delete branches. The consequence of this is that the details of previous changes will be lost. Doing the same thing under SVN won't lose any details. Here is an interesting link that shows the typical way of working under git: (with master as the core, constantly creating new branch and deleting old branch)
Local update, local restore. SVN can easily implement local update or restore because it sets up a .svn folder in each folder for management. If you only want to update certain parts, svn can be easily implemented. At the same time, the code is wrong, at the same time, you can well achieve local restore, of course, git can also be restored through the historical version, but can not simply achieve local restore.
Which is more suitable for project management, SVN or Git?
First of all, I am a project manager of a R & D team. I have used both SVN and Git. SVN is more suitable for project management, and Git is only suitable for code management.
The members of a R & D team normally include: requirements analysis, design, art, programmers, testing, implementation, operation and maintenance, and each member has products at work, including documentation, design code, and program code. all of these need to be managed centrally according to the project. SVN can clearly classify the management according to the catalogue, so that the management of the project team is in an orderly and efficient state.
Thank you for reading this article carefully. I hope the article "what's the difference between git and svn" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.