For details about git/SVN, refer to the five basic differences between git and SVN.

Source: Internet
Author: User
Tags how to use git version control system
Document directory
  • Git is distributed, and SVN is not:
  • Git stores the content in metadata mode, while SVN stores the content by file:
  • Git branch and SVN branch are different:
  • Git does not have a global version number, while SVN does:
  • The content integrity of git is better than that of SVN:

 

Before comparing the two, you can read:

SVN + git = fish and bear's paw:

Open-source version control git in the eyes of SVN users

How to Use git in the svn System

 

 

 

If you are reading this article, it means that you are as interested in git as most developers. If you have no chance to try git, I think you should understand it now.

Git is not only a version control system, but also a Content Management System (CMS) and work management system. If you are a person with the svn background, you need to make some ideological conversions to adapt to some concepts and features provided by git. Therefore, the main purpose of this article is to introduce what git can do and what is different from Svn in depth to help you understand it.

Well, let's get started...

  1. Git is distributed, and SVN is not:

    This is the core difference between git and other non-distributed version control systems, such as SVN and CVS. If you can understand this concept, you will be half done. You need to make a statement that git is not currently the first or only distributed version control system. Some other systems, such as bitkeeper and mercurial, also run in distributed mode. But git is doing better in this regard and has more powerful features.

    Git and SVN have their own centralized version libraries or servers. However, git is more inclined to be used in the distributed mode, that is, each developer will clone a version library on their own machine after chect out code on the central version Library/server. It can be said that if you are stuck in a location that cannot connect to the network, like on the plane, in the basement, in the elevator, you can still submit files and view historical version records, create a project branch. For some people, this seems to be of little use, but when you suddenly encounter an environment without a network, this will solve your major troubles.

    Similarly, this distributed operation mode is also a huge gift for the development of open-source software communities. You do not have to make a patch package as before and send it by email, you only need to create a branch and send a push request to the project team. This keeps your code up to date without being lost during transmission. Github.com is an outstanding case.

    It is rumored that the future version of subversion will also be based on the distributed mode. At least not yet.

  2. Git stores the content in metadata mode, while SVN stores the content by file:

    All resource control systems hide the object metadata in a folder such as. SVN and. CVs. If you compare the size of the. Git directory with. SVN, you will find that there is a big gap between them. Because the. Git directory is a clone version library on your machine that owns everything on the central version library, such as tags, branches, and version records.

  3. Git branch and SVN branch are different:

    The Branch is not special in SVN, that is, another directory in the version library. If you want to know whether a branch is merged, You need to manually run a command like thisSVN propget SVN: mergeinfoTo check whether the code is merged. Thanks to Ben for pointing out this feature. Therefore, some branches are often missed.

    However, it is quite simple and interesting to process git branches. You can quickly switch between several branches in the same working directory. You can easily find unmerged branches. You can easily and quickly merge these files.

  4. Git does not have a global version number, while SVN does:

    So far, this is the biggest feature missing from git compared with SVN. You also know that the SVN version number is actually a source code snapshot of any corresponding time. I think it is the biggest breakthrough from the evolution of CVS to SVN. Because git and SVN are different in concept, I don't know what features in git correspond to them. If you have any clues, please share them with you in your comments.

    Update: Some readers point out that we can use git's SHA-1 to uniquely identify a code snapshot. This cannot completely replace the number version that is easy to read in SVN. However, the purpose should be the same.

  5. The content integrity of git is better than that of SVN:

    Git uses the SHA-1 hash algorithm for content storage. This ensures the integrity of the Code content and reduces the damage to the version library in case of disk or network problems. Here is a good discussion about git content integrity-http://stackoverflow.com/questions/964331/git-file-integrity

Are the five differences between git and SVN? Of course not. I think the five are"Basic"And"Most attractive"I only think of these five points. If you find anything more interesting than these five points, please share them.

 

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.