Tag Archive for 'version control'

Page 2 of 2

Introduction to Apache Subversion

What is Apache Subversion?

Subversion is an Apache-licensed, open source software versioning and version control system that can track changes to files, folders and directories. It can also be used to recover previous versions of data, and examine the history of how a particular dataset has changed. Subversion can operate across networks, encouraging collaboration by allowing team members at various locations to work on the same set of data. Subversion can be used to manage any collection of files – web pages, binaries, documentation – not just source code!

Downloading and Installing Apache Subversion

Certified open source Apache Subversion binaries are available to download from http://www.wandisco.com/subversion/download

To install, open the file to launch the setup wizard and follow the onscreen instructions to define which components you wish to install, and the install location. Enter the name of your server, the host port, and define the repository and repository location prefix – and hit install.

Alternatively, uberSVN makes Subversion easy and intuitive to use, and is free to download and free to use.

Creating your first repository

Once Subversion is installed, the first thing you need to do is create a repository. To create your first repository, open the command line, change the current directory to where you want to create your repository, and run the ‘svnadmin’ command:

svnadmin create {directory name}

Checking out a Project

To start working on your project, you must check out a working copy of the repository. This is achieved with the ‘checkout’ command:

svn checkout file {file location}

Commit Your Changes

Once you’ve made some changes to your working copy, you’ll want to push your changes to the server. Perform an “svn update” and an “svn diff” to test your changes, and resolve any warnings raised by Subversion, before committing. Once you’ve finished checking your modifications, and are ready to store the new revision in the repository, run the ‘commit’ command:

svn commit {path}

Get other people’s changes

When someone else performs a commit to the repository, you’ll need to pull those changes into your working copy, to ensure the latest trunk changes are compatible with what you’re doing in your working copy. Changes can be pulled into your working copy with the update command:

svn update {file name}
svn update {directory name}

Adding Files to a Project

Now you know how to checkout a working copy and commit changes back to the repository – but as you continue to develop your working copy, you may wish to add some new files to your project. When adding new files to Subversion, you need to tell the Subversion server about the files with the following command:

svn add {file name}
svn add {directory name}

Note that the new files won’t appear in the repository until you perform an ‘svn commit’ and send them to the repository.

Deleting Files from a Project

If at some point you want to remove these files from Subversion, run the delete command:

svn delete {file name}
svn delete {directory name}

Again, you must perform a commit before the file is deleted from the repository. You can also run ‘svn list’ to confirm that the file was successfully deleted from the repository.

And if you get stuck…..

The ‘svn –help’ function provides a summary of available commands or, for more information on a particular command, use:

svn help {command}

Other useful commands

  • svn status {path} – prints the status of working copy files and directories.
  • svn diff – display the differences between two revisions.
  • svn merge – applies the differences between two sources to a working copy path.
  • svn move SRC DST – think of this as ‘svn copy’ that automatically deletes the source file. This command moves a file or directory in your working copy, or in the repository. Note that Subversion does not support cross-repository moving, so it is impossible to move files across repositories with this command.
  • svn list – allows you to view the content of the Subversion repository, without having to download a working copy.
  • svn log – Subversion remembers every change made to your files and directories. This command displays the commit log messages. By default, it will show the information for the current working directory of your working copy. Alternatively, different paths can be specified.

Need more info?

On June 14th, 2012 we will be hosting a free ‘Introduction to Subversion’ webinar. This course is intended as a primer for new users or people who are thinking of making the jump to Subversion, and will cover the following topics:

  • Repository basics – creating and organizing
  • Checkouts, working folders, editing files and checkins
  • Reporting on changes
  • Simple branching
  • Simple merging

This webinar is free to attend, but places are limited so register now to avoid disappointment.

10 Best Practices for Version Control

Used correctly, version control is an invaluable tool – but following some basic guidelines can help you get even more out of your version control system. In this post, we share ten best practices for getting the most out of version control.

1) Version control everything…..

Version control is no longer just for source code management. Thanks to user-friendly and intuitive tools such as TortoiseSVN and uberSVN, version control is increasingly becoming a tool for programmers and non-programmers alike. Consider encouraging every member of your team (including the non-techies) to keep all files and folders related to your project under version control. This could include meeting minutes and whiteboard notes, architectural designs and user documentation. Even for documents that are unlikely to change, it’s useful to have everything in one place and available to everyone on the team.

2) …but don’t treat version control as a backup system

Although version control does provide you with a backup of your files and folders on a remote server, using your version control like a backup system is a bad habit that doesn’t make the most of the system’s unique functionality (although it is possible to backup your Apache Subversion repositories.)

3) Commit easily readable documents

If you’re committing documents that require formatting before they can be read, consider committing them in a more accessible form, such as a PDF. In addition to making documents quicker and easier to access, this allows you to refer people directly to a document in the repository. However, remember to update both versions of the document when you make changes (or better yet, automate this process.)

4) Be consistent with your file/folder names

Implementing a logical naming convention will make it easier to locate particular items. Ideally, this naming convention should be explained in a coding conventions file, which is accessible to all members of your team, and this convention should extend to all the projects in your repository.

5) Commit little and often

Commit small changes frequently, instead of committing many small changes bundled into one large chunk. This will reduce the chances of encountering complications such as merge conflicts, and will reduce the complexity of such conflicts when they do occur.

6) Only commit finished work

Never commit half-completed code. This seems to go against the concept of ‘commit little and often,’ but the solution is to split the task you’re working on into manageable but logical pieces, and then commit these regularly.

7) Update regularly

This ties into the concept of ‘commit little and often.’ Perform regular updates on your working copy, to keep up to date with the changes being made in the trunk. This is important, even if it seems your current work has little to do with the rest of the team. It is also good practice to update your working copy before making any changes.

8 ) Make use of log messages

Always make use of log messages, and make sure you include as much information as possible (what changes were made, why, and by whom, etc.) If the commit deals with a specific bug or change request, include the issue or bug number in the log message.

9) Implement a sane project layout

Maintaining a version control system can become a complex task, so implementing a logical project layout from the beginning is crucial. Some version control systems, such as Apache Subversion, don’t impose a strict project or repository structure, which makes planning your layout in advance even more important.

10) Test, test, test

Get into the habit of systematically testing everything, especially before you perform a commit or a merge. Also consider CI and assertion testing on feature branches, which is a useful way to indicate code maturity and progress.

Apache Subversion: Still on Top in 2012

One of the common criticisms levelled at Apache Subversion is that, as a non-distributed version control system, it’s getting a bit long in the tooth, and the future of version control lies with distributed systems like GIT.

At WANdisco, we’re convinced this isn’t the case, and that Subversion is actually going from strength to strength. Only last year, Subversion 1.7 was released, a major step forward for the platform that included a completely rewritten working copy metadata system, support for a new HTTP protocol variant, ‘HTTPv2,’ and the svnrdump tool. When we polled the Subversion community a few months after this major update, we found that a whopping 68% of those surveyed had either upgraded as soon as 1.7 was released, or were planning to upgrade in the near future.

This proves that Apache Subversion still has an active user base, who are eager to upgrade to new releases of SVN. This is crucial to the ongoing success of Subversion as increasingly, the success of software hinges on “technology populism,” where individual workers, not organizations, create business trends. Subversion is easy to install, with a relatively easy learning curve and less administrative overhead than many competing version control solutions, and therefore we’re confident of its continued success in this increasingly tech populism-driven marketplace.

As you may already know, WANdisco is one of the major corporate sponsors of the Apache Subversion project. We provide a full suite of Enterprise products based on SVN, including Subversion Access Control, Subversion MultiSite and Subversion Clustering. We also offer professional support for Subversion and TortoiseSVN – but it doesn’t end there! We’re so confident that Apache Subversion is the leading version control solution, that we based our own open ALM platform on Subversion, uberSVN.

Since its launch last year, not only has this unique, SVN-based product been awarded the Made in Sheffield mark and Business IT Innovation of the Year medal, but it’s received a positive response from the community, as well as some fantastic reviews by the IT media. But what about the figures? Since its launch, we’ve had on average over 2000 downloads per month. For a brand new product, this is nothing short of amazing, and is further proof that the Subversion community is as vibrant and forwardings-looking as ever.

Subversion is also gaining momentum in the Enterprise space. The customer list for our Enterprise Subversion solutions reads like a who’s-who of the industry: HP, Intel, Sony, Nokia, Barclay’s Capital, Disney, Skype, Honda, and more. TortoiseSVN has also become the defacto standard Subversion client for Windows – most, if not all, of our Fortune 1000 clients use it.

With the 1.7 maintenance releases coming thick and fast, we’re confident that the future looks bright for uberSVN, WANdisco’s Enterprise Subversion products and, most importantly, the Apache Subversion project itself.

If you’re an avid Subversion user, then why not get involved in the project? The Apache Subversion site has all the information you need to contribute to the project.

Even More Free Subversion Webinars

We hope you’re enjoying our bi-weekly free Subversion webinars! After getting a great response from the community, we’ve announced the next few webinars in the series, including another webinar on branching and merging, as so many of you requested!

Here’s what’s coming up over the next few months:

  • Checkout Command – Although checkout is the most frequently used Subversion command, it has many options that few users are aware of. During this session, attendees will learn how to make full use of the checkout command and understand the messages it generates under different scenarios.
  • TortoiseSVN 1.7 New Features – Attend this webinar to learn all about the latest changes and get the most out of TortoiseSVN 1.7.
  • All About the Subversion Commit Command – Take a closer look at the Subversion commit command, including commit dialog options, unversioned files, changelists, and common problems and how to avoid them.
  • Introduction to Subversion – Back to basics! This course is intended as a primer for both new users and people who are thinking of making the jump to Subversion.
  • Version Control using Subversion – Learn a little more about the how and why we use version control; we will point out the advantages of version control, using SVN as an example.
  • Advanced Branching and Merging – This webinar will cover the meaning of merge messages, analyzing branches using revision graphs, using svn:mergeinfo and the different merge types (reintegrating a branch, merging a range of revisions, and merging two different trees.)

All these webinars are free, but places are limited. Register now to avoid disappointment.