Getting Started With Subversion Basic Concepts

Every developer has heard of the term Subversion or SVN. It is a system mainly used for development of software in a particular batch or group. The system is responsible for maintaining all the changes made in the projects and these changes are automatically updated in all the directories. Today we are going to discuss…

Every developer has heard of the term Subversion or SVN. It is a system mainly used for development of software in a particular batch or group. The system is responsible for maintaining all the changes made in the projects and these changes are automatically updated in all the directories. Today we are going to discuss the basic concepts of Subversion and this article is aimed towards the batch of beginners who have just started using SVN. However, before getting started with the topic, I would like to discuss some basic concepts.

  1. Source Control
  2. Subversion

What is Source Control?

The concept of source control is used in major projects with multiple level measures used in them. It is used to get rid of random code storage and prepare well-documented projects for large-scale development. You can use source control to keep track of the changes made in the project and your code will no longer curtail the overall development process. I am going to sum up some of the important features of source control.

  • Source control is a central place to store code of your project and get proper documented backup and recovery procedures.
  • Source control is aimed towards team development and helps in collaboration and easy access of code to the whole team. In short, one can easily manage a large-scale development of a central storage.
  • Source control has a feature of recoding all the changes made in the code of the project, which makes it much easier for updates and highly scalable.
  • Some other critical features of source code involve power of undoing any changes, facility to check the prior code and keep a check on product version.

What is Subversion?

When it comes to open-source version control systems; sub-version comes into light. Subversion is used for managing directories and files of a given project. Subversion works in the form of a tree, which is further placed in the central repository. The central repository of subversion can be compared to any ordinary file server except one feature. Subversion keeps a record of every change and updates done in the directory. In short, you can easily recover previous versions of your code and find out the changes made in the past. The control system is used by every single user with the help of a SVN client, which is used for making connections with the central repository.

Some of the important key points of subversion are discussed below:

  1. Subversion is an open-source version control system.
  2. Subversion provided a suitable replacement for CVS, especially for systems based on Linux; UNIX; and BSD.
  3. It is capable of tracking changes in any type of files in addition the directories.

Basic Concepts of Subversion

I guess you now understand the basic concept of Subversion and its usage. Next, we are going to discuss some common terms used in developing using Subversion.

Client Used for Subversion: First, you should be aware of the different SVN clients available for user access and get familiar with them. I am going to list out some important clients for SVN.

  • Apache Subversion
  • TortoiseSVN
  • Visual SVN
  • Subclipse
  • Rapid SVN
  • Synchro SVN
  • Smart SVN
  • eSVN

How to set up Repository: The first step of the process is to set up the repository to get started with the process. The best method of setting up a repository is to get free SVN from any of the online service provider. It can be difficult to start up with your own file server. All you need to do is to register at one of these clients and set up your local repository. The setup process variates from one site to another and you can get all the instructions from the site itself.

What are Revisions: Subversion uses the concept of Revision, which indicates a particular version of the folder or file? Whenever a particular change is made in the directory or code, an increment is made in the repository revision. Therefore, the user is capable of identifying any change by looking at that particular revision of the file.

What is Checkout: Checkout is a term used when the user makes a connection to the repository through his client and downloads files of the project for his Working Copy. It is also the first step to be performed in subversion and then you can start with the development process. Let us find out this command with Tortoise SVN: Create a new folder on your hard disc and right click on it. Select “SVN Checkout” option and you will be asked to provide the URL of your central repository.

Once you have entered the URL, files will start downloading to your local system. There will be a green check symbol (for Tortoise SVN) on each file's icon.

What is Working Copy: The copy of the current revision of the project downloaded by using Checkout is known as the Working Copy. Your work starts after downloading the file to files from repository. Once your work is complete, you can add the Working Copy to the main File repository and the changes will be updated on the Server (Central Repository).

How to Update: The central repository is updated after any changes made in the project. What happens is that with every change made in the project, the revision of the repository is increased. Your working copy gets out of date once you commit the changes to the central repository. Therefore, you can simply right click on your local copy and download any changes made from the repository.

What is commit: Commit is used to update the Central Repository with the changes you have done in your local Working Copy. You can commit your local Working Copy by Right Click and then selecting “SVN Commit”. You will be directed to a window where you can select the files and side by side enter log messages for the changes made. It will ensure the reason for which then commits command was executed.

Important Trade-offs of SVN

There is no doubt about the effectiveness of SVN for in large-scale projects but there are important considerations that you should make before working on it:

  • You need a good amount of disk space for setting up a local repository.
  • You need to control the system with all the file transfer and renaming with specialized tools. It requires an initial training to operate SVN effectively.
  • SVN require some maintenance time from the user. The user should make proper procedural changes and log entries while checking in or out of the system.

In short, Subversion is more suited for large-scale projects and systematic development. However, in case you are available with trained professionals and resources, SVN is the best implementation of your project development environment. As of now, I guess you have an idea of ​​Subversion and we will add up another post for basic commands used in SVN.