git and svn differences

Source: Internet
Author: User
Tags version control system

I heard that I want to use Git, first understand the next.

I hear the habit of using SVN, need a good conversion, to understand git.

I heard that git is not just a version control system, it also content management, work management what.

This article first understand the following:

1.GIT is distributed, SVN, CVS what's not ~

1) Git also has a centralized repository, but tends to be distributed. That is, after the developer has check out the code from the central repository, it clones a repository of its own on the local machine.

In this way, you can submit code, create branches, and so on in a network-free environment. Very convenient.

2) for open source projects, simply create a branch and send push requests to the project team.

This keeps your code up-to-date and does not lose the code in transit.

Most importantly, there is no need to find open-source management of children's shoes to do a series of operations ~ very convenient.


2. Git is stored by metadata, and SVN is by file.

All resource control systems hide the meta-information of files in a similar. Svn,.cvs folder.

The. Git directory is a cloned version of the repository on your machine that has everything in the central repository, such as tags, branches, version records, and so on.

3. The GIT branch differs from the SVN branch :

When using SVN, branching and merging branches are sometimes painful, especially when merging the trunk, if the new project is good, but if you develop new things on an old project, merging is a headache.

In short, the use of branches is relatively small, especially after the project is very simple, or lock version of this, this is almost rarely used.

If a branch is merged, the command line: SVN propget svn:mergeinfo to confirm that the code is merged.

The GIT branch is simple. You can quickly switch between several branches from the same working directory.

It is also easy to find the branches that have not been merged, simply and quickly merge the files.


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

The SVN version number is actually a snapshot of the source code for any corresponding time.

Git can use SHA-1 to uniquely identify a code snapshot. But isn't it convenient?

5. Git has better content integrity than SVN.

Git's content store uses the SHA-1 algorithm. Ensures the integrity of the content of the code, ensuring that the repository is compromised in the face of disk failure and network problems.

I think the content below is more interesting ~


6. Speed:

Clone a new directory, such as five branches. SVN needs to replicate 5 versions of the files at the same time. Very slow, deep experience.

Git only gets the elements for each version of the file, and then loads the main branch (master).

So git is much faster than SVN.


7. Version library (repository):

SVN can have only one designated central repository. Once there is a problem with the central repository, everyone is paralyzed and can only wait for the repository repair OK.

Git has an unlimited repository of repositories. Each git is a repository, the difference is whether they have an Active Directory (git working tree). If there is a problem with the major repository, others can also submit in their own local repository, waiting for the main repository to be repaired. You can also commit to another repository.

8. Branch (Branch):

9. Submission (commit):

SVN commits, directly affects the central repository.

The commit of git, which belongs to the local repository activity. Just push git push to the major repository. The git push, in fact, is to perform synchronization.


10. Re-establishment of the starting point (Rebase):

git, git rebase branch_name, you can put someone else's latest submitted code as the starting point of the current branch.

The merge will be considered up-to-date based on the time of modification, and rebase requires a resolution of the conflicting areas where both sides have changed.

11. System files:

Each of the SVN directories has. svn. Removal is also cumbersome.

Git will have a. git directory at the beginning of the directory, and. Gitignore.


Finish these, suddenly feel can use new things, although also not new ...

Git and svn differences

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.