git is not just a version control system, it is also a content management system (CMS), work management system and so on. If you are a person with an SVN background, you need to do some thinking to adapt to some of the concepts and features that Git offers. So the main purpose of this article is to help you get to know it by describing what git can do, and how it differs in depth from SVN.
Well, here we go.
The 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,CVS. If you can understand this concept, then you are already half-done. There is a need to make a statement that Git is not the first or only distributed version control system. Some systems, such as bitkeeper,mercurial, are also running in distributed mode. But Git does better in this and has more powerful features.
GIT has its own centralized repository or server like SVN. However, Git prefers to be used in distributed mode, where each developer Chect out code from the central repository/server and clones a repository on its own machine. It can be said that if you are trapped in a place where you can't connect to a network, like on a plane, basement, elevator, etc., you can still submit files, view historical version records, create project branches, and so on. For some people, this doesn't seem like much use, but when you suddenly encounter a network-free environment, this will solve your big problem.
Similarly, this distributed mode of operation is a huge boon for the development of the open-source software community, and you don't have to make patch packs like you did before, send them by email, you just need to create a branch and send a push request to the project team. This will keep your code up-to-date and will not be lost during the transfer process. Github.com is such a good case.
There are rumors that the future version of Subversion will also be based on distributed mode. But at least not yet.
2.GIT stores content as metadata, and SVN is file-based:
All resource control systems hide the meta-information of files in a folder similar to. Svn,.cvs. If you compare the size of the. git directory with the. SVN, you will find that they are very different. Because the. Git directory is a cloned version of the repository on your machine that has everything on the central repository, such as tags, branches, release notes, and so on.
The 3.GIT branch differs from the SVN branch:
The branch is not special in SVN, it is another directory in the repository. If you want to know if a branch has been merged, you need to manually run a command like this, SVN propget svn:mergeinfo, to verify that the code is merged. Thank Ben for pointing out this feature. Therefore, there are often cases where some branches are missing.
However, the branch that handles git is quite simple and interesting. You can quickly switch between several branches from the same working directory. You can easily find the branches that have not been merged, and you will be able to merge these files easily and quickly.
4.GIT does not have a global version number, and SVN has:
So far this is the biggest feature that git lacks in comparison with SVN. As you know, the SVN version number is actually a snapshot of the source code for any corresponding time. I think it's one of the biggest breakthroughs in the evolution from CVS to SVN. Because Git and svn are conceptually different, I don't know what features in git correspond to them. If you have any clues, please share them with you in the comments.
Update: Some readers point out that we can use Git's SHA-1 to uniquely identify a code snapshot. This does not completely replace the easy-to-read digital version number in SVN. However, the use should be the same.
5.GIT content Integrity is superior to SVN:
Git's content store uses the SHA-1 hashing algorithm. This ensures the integrity of the content of the code and ensures that the repository is compromised when disk failure and network problems are encountered.
Git Learning Summary (8) The basic difference between--git and SVN