Getting Started with Subversion or Git


A guest post by Mark Bathie, CTO of Codesion – a provider of version control hosting in the cloud.

For most software developers the question is not whether you should use version control, rather, what version control tool you should use. The most widely adopted is Subversion, but Git is the fastest growing.

Both are good, popular choices, but there are some core differences. Subversion, a centralized version control system, forces all developers to commit to a central server, whereas Git, a decentralized system, encourages many-to-many merging. For example, with Git you can merge to a fellow developer before merging with a central node (if there is one). There are other key differences I explore in this blog post and summarized below.



  • Centralized control, meaning its easier to keep one official history. Good for backups, accountability and security.
  • Security: Native subdirectory-level user access restrictions
  • Branches are easy and stored centrally
  • Gentlest learning curve for newbies, and operations like branching become quite intuitive as you progress
  • Ability to lock files, ensuring that others don’t work on the same binary files assets like documents & media files simultaneously
  • Widest adoption amongst developers
  • History of changes can’t be modified

  • Working offline means you can’t commit changes to the centralized repository until you have Internet connection, although this does not prevent developers from working on their local copy.
  • Generally slower than Git, since most operations need to synchronize with the central server, especially when merging large branches
  • Possible to revise history and preserve only their successes, not their failures



  • Decentralized model means many operations are faster, and makes offline work more practical
  • More merge options which are generally faster than Subversion
  • Branching is easier and faster
  • Comes with many tools like ‘bisect’ that can partly automate the process of finding where a bug was introduced

  • The local copy model means you need to be more careful of backing up your own workstations
  • The large set of commands can be esoteric and present a steeper learning curve
  • There are no locking for files which can cause issues with binary files
  • History can be changed, being able to edit past commits might not leave the strong paper-trail you’d prefer

Now that you’ve chosen your version control system (or your team has chosen for you), you’ll want to get up and running quickly. Here are some of the basics you’ll need to checkout and commit to a Subversion or Git repository.

If you’re creating a new project from scratch, you’ll need to add some files to a fresh repository. The first step is to create the blank repository. You may need to talk to your sysadmin to set this up for you, or use a cloud provider like Codesion. Once you have your repository access URL, checkout your files.

Checkout and Commit Using Subversion

Checkout your repository from the server to your local computer (your sandbox).
$> svn checkout –username mbathie

Now change into the directory and add a file.

$> cd mywidget

$> echo ‘echo “hello world”’ > hello.bash

Tell Subversion it should include this file (and any others) in the next commit, and in the repository from now on. Do this by using the “svn add” command.

$> svn add *

A    hello.bash

Then commit your new files to the server.

$> svn commit -m “adding my first file”

Adding         hello.bash

Transmitting file data ..

Committed revision 1.
Checkout and Commit Using Git

Checkout your repository from the server to your local computer (your sandbox).

git clone
This will prompt for your password, and then display the following

$> git clone

Initialized empty Git repository in /mywidget/.git/


Change into the directory and add a file.

$> cd mywidget

$> echo ‘echo “hello world”’ > hello.bash

Tell Git it should include this file (and any others) in the next commit, and in the repository from now on. Do this by using the “git add” command.

$> git add hello.bash

Commit the file to your local Git repository.

$> git commit -m “my first commit” hello.bash

Share your changes with other team members. In this case, we’ll push the changes to the designated central repository.

$> git push origin master

The remote Git server will respond with something like the following.

$> git push origin master


Counting objects: 3, done.

Writing objects: 100% (3/3), 228 bytes, done.

Total 3 (delta 0), reused 0 (delta 0)


* [new branch]      master -> master
Joining an existing project is essentially the same process as creating a new one, except when you perform the initial checkout or clone operation, you’ll be pulling down the files relevant to the project you are joining. You won’t be checking out a blank repository. You can then use the same commands above to add, commit and push your changes and share them with other team members.



5 Responses to “Getting Started with Subversion or Git”

  1. Zack Hovatter Says:

    Great article. I recently made the switch from svn to git, and I can’t say I regret it.

    • Mike Jessop Says:

      Thanks Zack,
      How have you found using GIT over Subversion? Do you use GitHub to still give you that central repository. Have you noticed any benefits from a distributed version control?

      What do you use for continuous integration?

      • Zack Hovatter Says:

        My requirements aren’t great. I don’t run community-drive code projects or anything like that. I mostly use git for my personal projects. The last time I’ve used svn was quite a while back, and I don’t have the best memory, so I can’t really explain more :P.

  2. Mike Jessop Says:

    At least you’ve got a repository you’re happy happy with now, right!

  3. Kelly Says:


    As you may be aware you have been shortlisted for your category in the Computer Weekly IT Blog Awards 2010.

    We would like to invite you to the awards. If you reply via email by Monday 25 October, I will be able to send you a formal invite to the event.

    Many thanks

    Kelly Hynds
    Marketing Executive

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: