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!
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…
I’m not a big fan of either Windows or C++ but I can’t help thinking they might be more widely useful than Ada!
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.
I didn’t know that about the Java license, although it would probably be wise not to use Java in safety-critical applications!