DEV Community

Cover image for What is the differences between GIT and SVN
Kareem Zock
Kareem Zock

Posted on

What is the differences between GIT and SVN

This article aims to present a comparison between the most common versioning control systems in the author opinion, so it is assumed that the reader already has some familiarity with code versioning systems, the concepts of revisions.

What is Subversion & Git :

Subversion is a centralized control system version that consists of a client (SVN)and a central server, accessed via TCP/IP, usually via SSH or HTTP/ WebDAV protocols. Initially developed by CollabNet in late 2000, and member of the Apache project since 2010, SVN has been adopted in many Java community projects due to the integration with development tools and features to solve problems of its predecessor - CVS - by the transactional support and performance improvements on communication between the client and the server.

Git was initially developed to meet the demands of a control version system to manage the source code of the Linux operating system kernel. The development of Linux by its very nature required a distributed versioning model, where commits are scattered in several parallel lines of development (branches) and must go through an approval process. This need led to the development of Git by the leader of the Linux project, Linus Torvalds. After the release of the first version in 2005 Git was handled to its current maintainer: Junio Hamano, a software engineer at Google.

Now let's take a look at the main difference between GIT and SVN through

this listing:

1-workflow:

-GIT:

A Git repository stores the full history of all of its branches and tags within the .git
The latest stable release is contained within the master
Active feature work is developed in separate branches.
When a feature is finished, the feature branch is merged into master and deleted.

-SVN:

The trunk directory represents the latest stable release of a project.
Active feature work is developed within subdirectories under branches.
When a feature is finished, the feature directory is merged into the trunk and removed.

2- Distribution:

-Git is a Distributed Revision Control System which means, every developer checking out code from the central repository/server will have their own cloned repository installed on their machine.

-SVN have a centralized Revision Control System or server

3-Storing data:

-Git stores content as metadata

-SVN stores content as files

4-Revision:

-GIT does not have a global revision no

-SVN’s revision no. is a snapshot of source code at any given time

5-Location and size:

Imagine you are a developer on the road, you develop on your laptop and you want to have source control so that you can go back 3 hours.

With Git, you do not have an SVN problem. Your local copy is a repository, and you can commit to it and get all benefits of source control. When you regain connectivity to the main repository, you can commit against it.

With Subversion, you have a Problem: The SVN Repository may be in a location you can't reach (in your company, and you don't have internet at the moment), you cannot commit. If you want to make a copy of your code, you have to literally copy/paste it.

6-content integrity:

GIT contents are cryptographically hashed using SHA-1 hash algorithm. This will ensure the robustness of code contents by making it less prone to repository corruption due to disk failures, network issues etc

SVN doesn't have hashed contents. This will risk losing code and contents due to disk failure, network issues

Git vs SVN Conclusion

So should you use Git or should you use Subversion? Take a look at your situation and your project and make a decision because neither is best, but one is often better for what you are doing.

Can be found on Techwebies

Top comments (0)