ArticleDirectory
- 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:
Http://www.aqee.net/2010/10/20/5-fundamental-differences-between-git-svn/
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...
- 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 pulls out from the central version Library/server.CodeThen, a version library will be cloned on your machine. 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 applicable to open-source software.CommunityDevelopment is also a huge gift. You don't have to make a patch as before and send it via 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.
-
- 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 that of. SVN, you will find that they are quite different. 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.
- 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.
-
- 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 any corresponding timeSource codeSnapshot. 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.
-
- The content integrity of git is better than that of SVN:
Git uses the SHA-1 hash for content storage.Algorithm. 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.