What are the advantages and disadvantages of git and SVN and their appropriate scopes? Open-source projects? Company project?

Source: Internet
Author: User
Tags version control system

It's not long before you use git:

1)Different Application objects.Git is applicable to developers involved in open-source projects. Because of their high level, they are more concerned with efficiency rather than ease of use. SVN is different. It is suitable for common company development teams. It is easier to use.

2)Use Cases are different.Git is applicable to the development of a single project with multiple development roles over the Internet. SVN is suitable for the development of multiple parallel projects that are centrally coordinated by the Project Manager within the enterprise.

3)Different permission management policies.Git does not have strict permission management control. As long as you have an account, you can export, import code, or even perform rollback. SVN has strict permission management and can control permissions for a subdirectory by group or individual. Separate read and write permissions. More strict, does not support rollback. Ensure that the code is always traceable.

4)Branch(Branch)The scope of use is different.In git, you can only perform branch on the entire repository, And once deleted, it cannot be restored. In SVN, branch can target any sub-Directory, which is essentially a copy operation. Therefore, you can create a lot of hierarchical branch and delete it when you don't need it. In the future, you only need to use the old SVN version of checkout.

5)Based on the third point,GitApplicable to simple software projects,Typical examples are some open-source projects, such as Linux kernel and busybox. On the contrary, SVN is good at multi-project management. For example, you can store the BSP, design documents, file systems, applications, and automated compilation scripts of a mobile phone project in a SVN repository, alternatively, you can store the file system of five mobile phone projects in SVN. In git, n (number of projects) * m (number of components) warehouses must be created. SVN only requires n or m at most.

6) git uses the 128-bit ID as the version number, and the branch must be specified during checkout. SVN uses an incremental serial number as the globally unique version number, which is more concise and easy to understand. Although gittag can be used to create literal aliases, it is only for Special versions.

7)Trackability,The typical development process of git is: Create a branch, perform development, submit it to the local master, and delete the branch. The consequence is that the previous modification details will be lost. If you do the same thing in SVN, no details will be lost. Here is an interesting link that shows a typical working method in git: (keep creating new branch and deleting old branch with master as the core ):

Http://www.kernel.org/pub/software/scm/git/docs/howto/separating-topic-branches.txt

8)Partial update and Local restoration.SVN creates a. SVN folder in each folder for management, so it is easy to implement local update or restoration. If you only want to update some parts, SVN can be well implemented. At the same time, the Code is written incorrectly, and Local restoration can be well implemented. Of course, git can also be restored through previous versions, but local restoration cannot be implemented simply.

SVNA centralized Version Control System
This approach brings many benefits, especially compared to the older local VCs. Now, everyone can see to some extent what other people are doing in the project. Administrators can also easily control the permissions of each developer.
There are two sides to the problem: Good and bad. The most obvious disadvantage of this is the single point of failure (spof) of the central server. If an instance goes down for one hour, no one can submit updates, restore, compare, and so on within this hour. If the disk of the central server fails and no backup is performed or the backup is not timely enough, data loss may occur. The worst case is that all history changes of the entire project are completely lost, except for some snapshot data extracted by the client. However, this is still a problem, you cannot ensure that all data has been extracted.
In principle, only the specific differences in file content are concerned. Each time you record what files have been updated and what rows have been updated.

The features of subversion are summarized as follows:

  1. Each version library has a unique URL (Official Address) from which each user obtains code and data;
  2. To obtain code updates, you can only connect to this unique version library and synchronize the updates to obtain the latest data;
  3. The submission must have a network connection (non-local version library );
  4. Authorization is required for submission. If you do not have the write permission, submission fails;
  5. Not every submission is successful. If someone else submits the changes to an outdated version, the system will prompt you to update the version before submitting the changes "... And so on;
  6. Conflict resolution is a fast submission competition: Fast submission, safe, and slow submission, and troublesome conflict resolution.

GitDistributed version control system
Since its birth in 2005, git has been mature and well-developed, and remains the initial goal while being highly user-friendly. It is fast and extremely suitable for managing large projects. It also has an incredible non-linear branch management system that can meet various complex project development needs.
Unlike SVN, git records version history only for whether the overall file data changes. Git does not store different data before and after file content changes. In fact, git takes snapshots of changed files and records them in a micro file system. Each time an update is submitted, it will view the fingerprint information of all files and take a snapshot of the file, and then save an index pointing to the snapshot. To improve performance, if the file remains unchanged, git will not save it again, but only connect the last saved snapshot.

Git has the following features:

  1. Each clone version library in git is equal. You can clone any version library to create your own version library, and your version library can also be provided as a source to others, as long as you want.
  2. Every Git extraction operation is actually a complete backup of the code repository. The submission is complete locally without authorization from others. You are the master of your version library, and the submission will always succeed.
  3. Even changes based on the old version can be submitted successfully. The submission creates a new branch based on the old version.
  4. Git commit will not be interrupted until your work is fully satisfied. If you push your version library to another person or another person, the merge will take place in the pull and push processes, if the conflict cannot be automatically resolved, you will be prompted to manually complete it.
  5. Conflict resolution is not a submission competition like SVN, but a merger only when necessary.
    And conflict resolution.

 

 

In short, the company's development team is a better choice for project development management, and team members jointly maintain the company's central version.

If it is an open-source project, git is more suitable. Everyone can maintain their own version and support the GitHub open-source community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.