: Version management
Version management
Version-management software is always used in program development. It offers indisputable advantages in large programs, such as returning to older versions and locating errors that way. The advantages in the programming project are the following:
- the program repository is specified in only one location in the department system,
- the repository contains all the applications made so far, neatly ordered, and
- students can use different computers and different operating systems to modify their programs anywhere (like at home and at the department).
In the programming project, we will use the NetBeans programming environment and Subversion, i.e. svn, version management program to implement version management. These applications are available on the department computers. We will only use the basic tools for version management during this course, to implement the following three events.
- Create one code repository.
- Copy the programming project you want to modify and develop from the repository.
- Confirm a project that has been modified locally to update it in the code repository (the changes will be copied to the repository).
The first will only be carried out once, and events 2-3 will be repeated every time we modify the programming project.
Creating a code repository
Each student will create their own code repository on the department servers with a terminal application.First, you have to log on to the Linux system, then start the Terminal program (Application/Accessories/Terminal).The program will display a command line view in the user’s home index, and the user should give the commands
mkdir svn cd svn svnadmin create repository
which will create the student’s own code repository called svn/repository for programming projects. In this repository, you can store several programming projects during your studies. Next start NetBeans.
For NetBeans to be able to use version management and store programs that have been modified and created during the session into the repository, you have to tell it where the svn program is located on the computer you are using, and where the code repository you just created is located. In the department’s Ubuntu system, the address for the svn program is usr/bin/svn, which you have to tell the NetBeans program through the menu Tools/Options/Versions/Subversion (finish by clicking OK).
Copy the project you want to modify from the repository
Now we will copy the contents of the repository (empty at this point) with the checkout command (Team/Subversion/Checkout) to the computer you are using.Based on the example above, the symbolic link location of the repository on the department servers is
file:///fs/home/kayttaja/svn/repository
The checkout command asks for this path information (Team/Subversion/Checkout) (select Next).
where we can make a copy of the repository and its management structure to the computer we are using by selecting Finish. Now the system is ready to modify programs and add new programs.
Accept the local changes
Using your home computer
It is easy to install NetBeans on your own computer.In the Windows environment, svn has even been added to NetBeans. It is loaded automatically when a user performs the checkout command for the first time.This means that you do not have to specify the location of the svn program in the Windows system.In other operating systems, you probably have to load some suitable svn software.In the NetBeans environment, it is easiest to contact the repository with the plink program (part of the putty freeware), which makes the repository address
svn+ssh://melkki.cs.helsinki.fi/fs/home/username/svn/repository
plink -l username-pw password
Details
Some links to online guides (you will find many more with a web search…).