How to Host Subversion (SVN)
A Complete Beginner’s Guide to SVN Version Control
What is SVN?
Subversion is a centralized version control system for managing versioned files such as source code, web pages, and documentation. This article assumes that you, dear reader, are familiar with version control systems. If not, the shorthand definition of a version control solution is any system that records and stores file changes, allowing revisions to be made from a specific point in your development history.
Subversion is also open source versus commercial option, such as Helix Core. Helix Core is selected by many for its scale, performance, and support. These features can be more difficult to achieve with open source tools.
Here are some helpful terms and concepts on SVN hosting.
A repository is where the code and its history are stored. The repo can be accessed various ways depending on the server where it’s hosted, either from an organization’s internal server (on-premises) or from an external, web client (SaaS cloud server).
Because SVN is centralized, development teams always have one central repository for one or many local checkouts, with any and all changes able to be contributed back to the central repo as soon as they’re ready.
For teams that want a cloud hosting option to handle their large-scale repository management, SVN hosting services allow teams to create a repo in the cloud, manage its access rights, and control everything as you would from an internal SVN server, minus the cost of maintenance and management. Cloud hosting services are becoming increasingly popular, as teams prioritize development over added IT infrastructure and cost.
However, on-premises SVN hosting is the choice for many organizations, too, as cloud hosting often lacks the comprehensive security and stability features of an organizationally managed solution. With valuable IP at risk, many development teams opt for an on-premises solution to manage access controls, repo and branch-level permissions, and ensure developer uptime.
Commits are the saved state of code changes for specific points in time. A commit is literally saving your development progress; every commit is a mile marker on your product’s roadmap.
Commits in SVN are done between the local checkout and central repository. Changes are committed to the central repo. Each commit includes both the changes and a commit message, which gives details on the changes you’re introducing.
$ svn commit –m “removed old file ‘feature x’ .” Deleting feature x Committed revision 2.
The more explanatory your commit messages, the more visibility and insight you'll gain from your code changes. What’s more, commit messages can provide clarity to past or archived changes that would be confusing without context.
For the most part, everything you do within SVN follows a development pattern, or lifecycle. Here’s a quick rundown of what that roadmap looks like:
- Checkout a repository
- Perform changes
- Review changes
- Revert changes
- Resolve conflicts
You’re ready to make great products. You’ve got your developer hat on. Let’s get started.
Before you can make any changes, you must first check out a repository from your hosted SVN workspace. SVN checkouts will bring over the latest revision of the repository you want to work with. If you’ve just created the repo, no commits exist yet and no revisions will be found, so you’ll be on the first version of that repo.
Once you have the SVN repository checked out, you can start making changes. Choose from your favorite developer tools and editors to perform changes to your repository that reflect your product development goals.
Submit changed files to your repositories and track those commits using your SVN host’s client UI.
After submitting various files, it’s important to review the changes you’ve made. SVN hosts will take file updates committed to an individual repo and list them as revisions. If you’ve added five versions of the same file to a repo, you can navigate that complete history from versions 1,2,3,4, or 5. SVN hosting tools make that review process simple and easy to execute.
Did a developer submit a glaring error that needs to be rolled back to a previous version? Well, then…
SVN provides a command that can revert your file changes to a previous, healthy version. Simply use “svn revert” in your command line to bring your file back to the state it was before your edits. And the command isn't limited to individual files. You can revert entire directories or repositories in a single command.
Conflicts occur when two adjacent developers are making changes to the same file — this is a particularly common occurrence in large organizations, where repos and files permeate the enterprise.
Conflicts are a part of a normal development workflow and are pretty straightforward. Basically, you have three options. 1) “My colleague’s changes are best. Forget mine, we’ll use his.” 2) “Man, I’m smart. My changes are best. Sorry, colleague, we’re scrapping yours.” Or 3) “Our changes work best together. What a great team we are. Time to merge and commit.”
Using a simple merge workflow, users can mark merge changes as resolved and commit the new-and-improved file back into the project environment.
And that's it! You'll use some variation of this approach to fuel your development process over and over again, across 1000s and 1000s of files, across your SVN project repos. The effectiveness of your development approach, however, will hinge on whether your SVN hosting platform is the best fit within your organization.
Your Version Control and Code Hosting Partner
Now that you know more about SVN and, perhaps, are thinking an SVN-hosted solution is right for your development environment, why not team up with an industry-proven partner who can help you get the most productivity out of your environment?
Helix TeamHub is the only code hosting and developer collaboration tool that supports SVN repository management, in addition to Git, Mercurial, and Maven. Perforce provides hosting options for teams of all sizes, both on-premises or in the cloud.
What Helix TeamHub offers out-of-the-box:
- Unlimited private SVN repositories
- Daily backups, highly reliable, +99.99% uptime
- Integrations and webhooks for industry-preferred tools, such as Jenkins, JIRA, and Slack
- Built-in code review, issue tracking, and delegated access management
If you’re considering a solution to help manage and host your SVN repositories, consider Helix TeamHub, featuring pricing options and license tiers that fit every organization, large or small.
Helix TeamHub is free to get started with hosting for up to 5 users and 1GB of data.