Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Advantages of SVN over Git

To be clear, I am happy with using both SVN and Git and use whichever one is most appropriate as each have their advantages. However, I feel it's worth making this post as there seems to be a bit of a git bandwagon where people just disregard SVN.

Forced Collaboration

Because git is distributed and SVN is centralised, whenever you make a commit in SVN, you commit to the server. This forces developers to take each other's changes into account sooner rather than later and reduces the chance of hard-to-resolve-conflicts occurring because developers have deviated too far from each other. Git on the other hand allows developers to work locally and worry about merging right at the last possible moment, when one developers changes are way off from what everyone else has been doing. Git even promotes this behaviour because because features like re-basing are a lot easier if you haven't made your changes public. With SVN, every developer can check on the progress of all other colleagues' branches, and raise it with them if they see that the branch is taking a path that might not work well with other changes. With git, one won't know this until the branch attempts to merge in, or the developer decides to make their changes public by pushing their branch to the server.

Working In the Wrong Branch

With git, its pretty easy to work in the wrong branch as you might have just forgotten to run that checkout command, or started working away not realizing you left the repository in a branch instead of master. With svn, you have all the files laid out in front of you, so it's pretty obvious from the path what branch you are working in and harder to make this mistake. This is why I had to make the tutorial Git - Move Recent Commits To A Branch.

Checking Out Subdirectories

With SVN, it's easy enough to checkout just a subdirectory, but it isn't quite so easy with git.

SVN Can be Faster

With SVN you only have to sync the differences between what you have and what is on the server which is much faster than Git, especially if you've been on holiday for a few weeks whilst other developers cracked on. Because git is distributed, you have to sync down all changes, even if those changes were to add GBs of assets which subsequently got deleted, resulting in no difference at all. This is also especially true if you have only checked out a branch, which nobody has touched!

Easier Merging

I find merging in SVN to be easier than with git simply because I can see both branches in front of me on my filesystem. This gives me more flexibility. Having said that, Git is much more better at handling file renames in merges. SVN just considers renames a delete and an add of a file which often causes conflicts.

User Permissions

SVN has a built in permissions system for user accounts. With git, its probably best to use SSH keys to restrict access to the git server to achieve the same effect, but there is no built in system. Tools like Gitlab and Github put their own permission systems in place, but this is not part of git itself.

Last updated: 9th May 2020
First published: 16th August 2018

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch