Git vs Subversion

From WikiVS, the open comparison website
Jump to: navigation, search

Contents

[edit] History

Subversion (SVN for short) was created by CVS developers to be a replacement for, and improvement on, CVS.

Git was created by Linus Torvalds to replace BitKeeper as the version control system for the Linux kernel.

[edit] Architecture

Git is a distributed version control system. This does not mean that centralized development is impossible; a centralized development model would be possible just by taking one Git repository and canonicalizing it.

Subversion is a centralized version control system. SVK was written as an extension of Subversion to provide distributed version control functionality.

[edit] Licensing

Git is distributed under the terms of the GPL, a copyleft license.

Subversion is distributed under the terms of the Apache License, a copyfree license.

See Copyfree vs. Copyleft for more about these licensing options.

[edit] Performance

Git is faster than vanilla Subversion for local commits because all repository files are on the local drive, though SVK provides local commit capability as well.

[edit] Features

[edit] Hooks

Both Git and Subversion support hooks.

[edit] Branching

Git was created with branching in mind, to encourage branching and experimenting with the code base. Branches are essentially a way to refer to a commit, since the commits are arranged using a DAG.

One of the reasons for Subversion's creation was to provide better branch and merge capability than CVS. SVK provides distributed branch and merge capabilities on top of the centralized Subversion model, while svnsync provides read-only cloning capability to cover certain distributed branch benefits without having to use SVK.

Subversion's merge capabilities are much more limited and than Git's. Prior to version 1.5, Subversion did not keep track of merge data, so revisions to be merged had to be specified manually in a tedious and error-prone process. Since version 1.5, Subversion has tracked merge information, but the process is still complex and limited. Once a branch has been reintegrated back into trunk, the branch can no longer accept new revisions without additional action being taken. [1]

By contrast, Git can merge any two branches with few if any problems.

[edit] Sparse Working Copies

Subversion and Git both support “sparse checkouts”, in which only some parts of a large repository are checked out into the working copy. This can be useful to reduce disk usage. However, while Subversion operates on trees (and hence can avoid even downloading unwanted directories from the repository), Git operates on changesets (and hence will still download the unwanted data, just refrain from unpacking it into the working copy). This means that Git must transfer over the network, and store on disk, the entire contents of a large file or directory, even if the user has no interest in the data and will never check it out.

[edit] Popularity

Subversion is the most popular open-source version control system in use. It is widely used in open-source projects as well as within proprietary software companies. Even in cases where open source projects have adopted other version control systems, many of them maintain parallel repository access via Subversion as well.

Git is quickly gaining popularity in the open source environment. Software vendors, however, often do not use Git for their version control system because of its distributed nature; software companies want to maintain a central repository of their code-base, and consider the ease with which independent branches can be created unnecessary or even undesirable. Proprietary software development shops also tend to balk more at the GPL distribution terms of Git than at Subversion's more liberal licensing terms.

[edit] Links

[edit] Pro-Git

Tech Talk: Linus Torvalds on git (video)

See Also the Following Articles

Personal tools
Namespaces
Variants
Actions
Navigation
Ads
Toolbox