Aside Posted on Updated on
What is SVN ?
Subversion is a version control system that keeps versions of your files in a “repository”, which we will provide for you on a server. The repository will enable you to retrieve (“checkout”, “update”) and store (“commit”) your files from multiple location. It also provides a backup mechanism for you in case you ever need to revert to older versions of your code. [Source: http://www.ccs.neu.edu/course/cs2510h/Subversion.html]
In this tutorial I will show how can you setup a SVN server in local area network. The main motivation behind this is to make a centralized repository from where all the developers will be able to fetch and submit their codes.
Practical example: Let’s consider that you are teaching a programming course and you have to grade the programming assignment of your students. Getting source code/project from each student can be very painful, instead of that you can make a centralized source code repository and students will submit to that repository ( a computer placed in local area network)
Platform: Windows 7 (client side) , Windows 8 (server side)
Software: Eclipse (IDE), Subclipse 1.10.x (SVN plugin required for eclipse) ,Visual SVN (SVN repository software)
1. Download Visual SVN Server from following link: http://www.visualsvn.com/server/download/ and install it to the system which you want to make the server (central repository). Unlike Eclipse, Visual SVN will be installed on one PC only.
2. Start the installation, click next to continue the installation process. I didn’t change any settings.
3. Provide the location of Visual SVN and your Repository location. Also don’t forget about the port. I m using default 443, make sure that there is no service or any other server using this port, if there is then change port to 8443.
4. Finally Visual SVN will be installed. Double click it to run it.
5. Create a repository, I made one titled “Assignment_1_Rep”
6. At the end of repository creation, a URL/path provided will be you. Note this down, as addressed will be given to access the rep.
7. Visual SVN provides user management too. You can add and delete users. I have made two users Bilal and Aliya both have password ‘admin’. However, its not a good practice to choose admin as password, you must use a random password. Visit random.org to get a good random password.
8. So, our server side configuration is done. We have successfully installed and configured Visual SVN, now its time to configure the client side.
9. Download Eclipse IDE which suits your requirement, I’ll be downloading Eclipse for C/C++ developers 64 bit edition. Link to download is: http://www.eclipse.org/downloads/
10. The zip folder will be downloaded, extract the folder and place in your desired location. I’ll be placing in my C drive.
11. Run Eclipse. Now its time to install SVN plugin for eclipse. For this I’ll be installing the latest subclipse plugin which is v 1.10x (link: http://subclipse.tigris.org/update_1.10.x/). Go to ‘Help’ tab and from there click on ‘install new software’ and a new window will popup.
12. Click on ‘add’ button. Name it whatever you want and place the link mentioned above and press OK.
13. Check the Subclipse and click next to install the plugin.
14. The plugin will start downloading, in bottom right corner of Eclipse, you can see the percentage of plugin downloaded.
15. At the end of the setup, Eclipse will ask you for a restart. Click on YES to restart Eclipse. Congratulations, your SVN plugin is installed.
16. Now its time to commit our code in the SVN repository. In step 6 we were provided a URL, this URL will be used by the clients for committing and fetching their code. The URL was: ” https://AIS-LAB-PC14/svn/Assignment_1_Rep “. In the URL ” AIS-LAB-PC14 ” is the name of the server, we need to replace this with the IP of the server. For this you will have to check the IP of your server.
17. So in our case, the IP of the system on which Visual SVN is installed is: 10.2.31.164. So, our final URL will be ” https://10.2.31.164/svn/Assignment_1_Rep “. Every client should be provided with this link.
18. Now, its time to commit the code. We have created a simple Hello World project. We will be submitting the whole project in the repository. For this right click on the project folder, and under Team tab, click on ‘share project’
19. Chose SVN (GIT is another type of repository, I’ll make a tutorial on it in near future)
20. Select ‘create new rep’
21. Provide the URL
22. Click finish. A message will pop up. Asking the authentication of digital certificate. Click accept permanently. This shows our connection has successfully been established with the Visual SVN server.
23. Provide the username + password, I’ll be giving bilal as username and admin as password (both username and password are case sensitive)
24. The message shows that our source code has been submitted to the repository.
25. Next time you don’t have to repeat the whole process of submitting the code, just right click on the project folder, go to team and now in share project you will be able to see a lot of options.
So this was all guys. I hope this tutorial helps you. Feel free to ask (stupid) questions. Just kidding.