Revision as of 17:44, 5 November 2009 by Admin (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Using Subversion (SVN) Local Repository

Contributed By; Tushar Joshi


Maintaining source code of our projects in a version control software is very important for the maintenance of the project. In large projects the projects are hosted on a server bases source control repository. NetBeans support Subversion, one of the popular source control server softwares.

Subversion allows us to create local repositories also to store our projects and manage the versions on local machine. Let us look how to install Subversion, its client TortoiseSVN and then use it to store our project locally in a source control repository.


Tools required

We will need two important software binary installers.

Installing Subversion

We will copy the svn-win32-1.4.6.zip file which we downloaded into C: drive and will ask our 7Zip shell extension menu to extract the file right into the C: drive.


NetBeans IDE checks the availability of svn.exe command in the windows executable search path which is set as an environmental variable PATH. We will need the Subversion binaries to be in our windows path so NetBeans IDE can find them and use them. We will copy the path of Subversion binaries.


This path must be set into the PATH environmental variable in windows. To set the PATH environmental variable I will right click the My Computer icon, select Properties, select Advanced tab and click the Environmental Variables button.


This will show me a dialog box for Environmental Variables. Here I will click the PATH variable and will choose the Edit button to add one more entry for the Subversion path. The paths in windows are separated with semicolons; so we will remember to add a semicolon before the path.


To check whether our Subversion binaries are really available in the windows executable path we will open a command prompt and type

svn --version

This command will show me details of the installed subversion.


Note that Subversion is installed just be copying the ZIP file and extracting the archive. Then the bin path is added in the windows PATH environmental variable. To create a new repository for our local use we will use the TortoiseSVN windows shell extension client. The local repository can also be created through a command line without using the TortoiseSVN client but through TortoiceSVN it becomes easier.


We will create a new folder named svnrepo in C: drive. Then we will right click on the folder choose the TortoiseSVN > Create repository here... option and the repository will be made for me.


Tortoise will ask which type of repository is wanted and we will keep the default Native filesystem (FSFS).

Using Subversion

Now we are ready to use the subversion version control system in our NetBeans IDE projects. Let us open the project in NetBeans and right click on the project name.


We can see the versioning option has option of Import into Subversion Repository... By choosing this option we will tell NetBeans that we want to store our project in a repository.


NetBeans IDE will ask where to keep the project, i.e. the path for the repository. There are many ways to describe the paths for Subversion repository and they depend upon how the repository is set and on what protocol it is available. As we are using the repository locally we will have to use the FILE protocol.

So we will type file:///C:/svnrepo as our path for the local repository.


We must specify the message for checking in the project into subversion repository.


NetBeans shows all the files that will be checked in the repository when the wizard completes. I will click the finish button and the project will be added to the local subversion repository. NetBeans IDE shows a visual clue attached to the project icon showing this project is now under version control.

The project when right clicked now shows a Subversion option menu and Subversion sub-menu shows options to Update and Commit the files into the repository.


As soon as there is a change in the files of the project the files are shown in different color and the visual clue is shown with the icon of the file.


Committing Changes

When we are done with the updates we right click the file and say Subversion > Commit and NetBeans IDE offers dialog box where we have to type the commit message and then the file updates are stored in the source control repository.


This is how NetBeans makes it easy to manage the project in a local source control repository.

See Also

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo