Wednesday, February 5, 2014

How to use SVN (Subversion) effectively

This post is intended for SVN users on Eclipse IDE.

To use SVN effectively, you need to consider the following:
To update your code, it is better to synchronize your code with remote code in the repository. Right click the desired file, package, or project >> Team >> Synchronize


The Synchronization panel will open showing you something as a colorful report. The Blue marked file, means that there are changes was made by you team and existed on the repository. UPDATE operation required.

The gray color tells you that your code have some modifications and it different than what exists on repository. COMMIT operation required.


Before doing any commit or update operation, you can see the incoming changes, or the outgoing changes by double clicking on the desired file. The review view will display your local file, and its remote counterpart, and the changes will be marked by small boxes to the right of the panel, as shown in the figure below.



After reviewing your code, and making sure that there are not conflicts between yours and the remote code, right click on the desired file, and choose update.



Apply the above if you want to commit any changes you have.



Best Practices
To avoid losing your code, or overriding your team code consider the following best practices.
1.            Update your code before starting coding at morning. This way, you will be sure that you are adding on your team cod, and not overriding it.


2.         Make sure to update your code before committing your changes, to make sure that you took the latest modifications from your team, when your code is synchronized, you can commit your changes safely.