Reliably Avoid Subversion Collision – Commit First!

Subversion is a source control system – an excellent accompaniment to software development especially in a team setting. When working with a number of people, it is likely that at one time or another there will be collisions – for example at the moment a project I am working on has a team making some amendments requested by the client for a website. Subversion is handling it all well but the main template files and stylesheets are colliding often as everyone is making changes.

Commit First!

The collision will only occur if you check in a change and someone else has already changed that line in a file. To avoid getting a collision in your working copy, the best thing to do is to commit your change before the other person does.

This approach of commit early, commit often will help you to develop more smoothly without the interruptions of a collision and without struggling with lots and lots of merged files when you’ve left it too long between commits. Additionally you’ll have more checkpoints in your own development history so if you need to go back a few steps, the repository will be able to help you whereas if you didn’t check in, it won’t!

That’s my tip for the day – on a day in a place where many people are bug fixing a single project!

4 thoughts on “Reliably Avoid Subversion Collision – Commit First!

  1. Please tell me you aren’t still working at this time of night!

    Though having said that, I might be soon. I start on a project on Monday (C / C++ for Windows – I do Ada for Unix…), planned for 3-4 months, due early November. Strangely, I’m looking forward to it…

  2. I think that Ada is used for military work and for stuff like aeroplanes. Try reading the Java license someime – it used to state that Java should not be used for some of the above items.

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.