background preloader

Subversion

Facebook Twitter

Working with Subversion — Circle Six Blog. Subversion for Web Developers | Django Web Development - Lincoln Loop. Posted in Subversion I switched from Ubuntu Linux to a Mac last week. I knew the new system would force me to adapt my workflow a bit so I figured it would be a good opportunity to break some bad habits. One of those bad habits was how I manage site and code updates. My typical cycle was to build the site on a local development server, upload the site, present to client, then go through a tweak → upload → tweak → upload cycle until the site was perfect. No revision backups are maintained, unless you are manually doing them. Enter Subversion. My situation is a little different from their’s. If you are doing PHP development, install a MAMP environment from MacPorts (tutorial here) Install Subversion from Martin Ott’s binary.Create ~/svn folder for repositories and use ~/Sites for my checkouts and development.Test.

Once you’ve got everything is working, lets create our first project. cd ~/svnsvnadmin create domainname.tldmkdir -p domainname.tld/trunk/public_html. Subversion Users - SVN and web development. Web Development Environment and Workflow. Over the years I have worked with a bunch of teams and solo. I usually go with the flow as far as the group workflow. I have had to roll my own subversion workflow in the dark days before it was a normal and expected thing to do. Here is a rundown of the major types of workflows I have used… My Ideal Web Development Environment For environments where you can’t test locally and are the only person with access to the testing server Subversion Repository Trunk Stable Development: Local working copy A local checkout of trunk Edit locally Upload changes to testing server and test Commit from local working copy Deploy: Merge trunk to stable Deploy stable to testing server for final test Deploy stable to production This is a slow and annoying way to work!

UPDATE: Rob McBroom has come up with what looks like a really handy way to use TextMate to work with remote projects. For environments where you can’t test locally and share a single testing server with other developers. SVN::Notify::Mirror::SSH. SVN::Notify::Mirror::SSH - Mirror a repository path via SSH Use svnnotify in post-commit: svnnotify --repos-path "$1" --revision "$2" \ --handler Mirror::SSH --to "/path/to/www/htdocs" \ [--svn-binary /full/path/to/svn] \ [[--ssh-host remote_host] [--ssh-user remote_user] \ [--ssh-tunnel 10.0.0.2] \ [--ssh-identity /home/user/.ssh/id_rsa]] or better yet, use SVN::Notify::Config for a more sophisticated setup: --- '': PATH: "/usr/bin:/usr/local/bin" 'path/in/repository': handler: Mirror to: "/path/to/www/htdocs" 'some/other/path/in/repository': handler: Mirror::SSH to: "/path/to/remote/www/htdocs" ssh-host: "remote_host" ssh-user: "remote_user" ssh-tunnel: "10.0.0.2" ssh-identity: "/home/user/.ssh/id_rsa" Keep a directory in sync with a portion of a Subversion repository.

Typically used to keep a development web server in sync with the changes made to the repository. This directory can either be on the same box as the repository itself, or it can be remote (via SSH connection). Remote Mirror. Using SVN for Web Development. As our web applications grew and more and more developers started working on them, it became obvious that we needed some kind revision control system to manage our code.

As CVS is quite dated and Subversion (SVN) introduced some handy features (atomic transactions, Apache piggybacking, more convenient branching/tagging, tons of other improvements), we chose to go with SVN. The big question was: how to use it correctly? After coming up with some more or less weird ideas I think we finally found a decent solution to put a web application into source control. Keep in mind that this post is not about how to use SVN itself, it’s rather about the system architecture for using it in web development. If you need help with Subversion, you can find it in the manual and the FAQ.

Managing web applications in SVN is tricky for some reasons: When using revision control, a programmer is always working on a ‘working copy’ of the project. So this is what we’re going to need to make it work: Webservers. SVN installation on Windows. Protecting Your .svn Folders With .htaccess | FettesPS. Subversion is a powerful tool. Not only does it allow multiple developers to collaborate on a project, but it allows you to easily deploy your projects to the production server. If you are using a checked out repository on your production server, rather than an exported copy, it is crucial that you protect your hidden .svn directories. If you do not take measures to protect these hidden folders then your website will become extremely susceptible to attack.

Your .svn folders contain the pristine copies of every file with a .base extension. This means that someone with a little know-how can navigate through your .svn folders and download your config files and obtain sensitive information such as your database password. On top of that, they can simply steal all of your code and reproduce your site elsewhere with their name on the bottom. So how do you protect your site against these attacks? With these in place your website is now much a safer place. Version Control with Subversion - Repository Maintenance - Migrating a Repository.

Migrating a Repository A Subversion filesystem has its data spread throughout various database tables in a fashion generally understood by (and of interest to) only the Subversion developers themselves. However, circumstances may arise that call for all, or some subset, of that data to be collected into a single, portable, flat file format. Subversion provides such a mechanism, implemented in a pair of svnadmin subcommands: dump and load. The most common reason to dump and load a Subversion repository is due to changes in Subversion itself.

As Subversion matures, there are times when certain changes made to the back-end database schema cause Subversion to be incompatible with previous versions of the repository. Other reasons for dumping and loading might be to migrate a Berkeley DB repository to a new OS or CPU architecture, or to switch between Berkeley DB and FSFS back-ends. . $ svnadmin create newrepos $ svnadmin dump myrepos | svnadmin load newrepos. JT Bullitt / Earth Sound » Quickie: using SVN for website development. Subversion User List Archives. Pixel Acres » Blog Archive » Subversion for web development: Part 1. In this three part series of articles I will explain my approach to using Subversion, the open-source version control software, for web development. For a long time I steered clear of version control, dismissing it as too complex, or something that was only useful for large development teams.

I took Subversion for a test drive, but didn’t really “get it”, and decided version control wasn’t for me. I changed my tune earlier this year when I was employed to work on a project that was already under version control. I had no choice but to get up to speed with Subversion, and once I got the hang of it I was excited to discover that version control streamlined my entire workflow. My approach to Subversion is geared towards solo web developers like myself, and is fairly easy to grasp. Part 1: Getting started with version controlPart 2: Working with Subversion repositoriesPart 3: Servers and deployment What is version control? Roll back. Why use version control? Version control for web development. Beginning the SVN Journey — Circle Six Blog. Using SVN for Web Development. Setting up Joomla Sites with SVN.