Setting up a local Subversion repository to use with your Eclipse

I’ve been spending some time studying a tool for looking at the structure of code bases. After having tried out some of the more basic possibilities I wanted to go for the finer points and study changes between two versions of code to see what effect my changes made. This is where I realise that I would like to have a local Subversion repository not only for this, but also for how it would benefit some of my hobby projects. After some googling I found my way to http://subversion.tigris.org/project_packages.html where, since I’m on windows, I picked the windows path. I end up downloading the latest version of Subversion: http://subversion.tigris.org/files/documents/15/45344/svn-win32-1.6.0.zip

I unpack it in “C:Program FilesSubversion”. To get the commands to work you have to add the bin to your path. In my case I add “C:Program FilesSubversionsvn-win32-1.5.6bin” to the path. After this I open up a command window and do the following:

Now, in order to make Subversion work in Eclipse I add http://subclipse.tigris.org/update_1.6.x to my update sites. After downloading this I restart my Eclipse and go to Window -> Show View ->Other->SVN -> SVN Repositories.
I right click in the opened view and create a new repository location. Instead of writing a http adress in the URL window I now type “file:///C:/subversionRepository/project1″. Notice the three forward slashes after “file:”.

I now have an empty repository that I want to put my project into so I right click on the repository and add a new remote folder that I call trunk. Right clicking on the trunk I can now import my project by importing the folder that contains the .project file. I hit F5 to refresh the view and can see that the trunk is now filled with my first version of my project.

But I also have to associate the repository version with Eclipse, so now I right click in the Package Explorer and choose Import -> SVN -> Checkout Projects from SVN. I pick my previously created repository, click next, mark the trunk and then click finish. I get a question if I want to overwrite my previously created project with the same name and say ok. I won’t need that now that I got a versioning system!

I can now finally continue my studies of the tool I was looking into.

18 Responses to “Setting up a local Subversion repository to use with your Eclipse”

  1. Lee says:

    Thanks for this info!

  2. pascal says:

    Thanks.

  3. Sherin says:

    Hey Thank you so much for this article really helped me a lot

  4. bob says:

    Thank you! Saved my time!

  5. xmichaelx says:

    Thank you for article! :)

  6. jordi says:

    Great article! Thank you very much!

  7. belal says:

    thanks for sharing , looking for this from long time

  8. Zach says:

    Now you have a local SVN setup, how do I share his with people I want to work with?

  9. Amyne says:

    Thanks A lot for your helpful tip , but when i was searching for the local svn server , i found another easy way… there is a software called Visual svn you can create local ripositories and managed them with an easy and efficiant way !
    Downalod link here : http://www.visualsvn.com

  10. Enrique says:

    Just to say Thank You!
    Also I want to add something, It’s not neccesary to install Subversion, if you install TortoiseSVN you can make the repository with it and it will work too.

  11. Abhishek says:

    Thanks for this useful article. This should be put on subclipse website. Thank you.

  12. Rob says:

    This was exactly what I was looking for. Thanks a lot.

  13. Oded says:

    Why can’t life always be as simple as this…? thank you!

  14. lynton says:

    thanks for the quick and easy svn / subclipse setup tip, especially useful b/c you described how to do it from existing project source.

    now my eclipse project source is snugly and safely version controlled.

  15. TudorD says:

    Yeah. Thanks, it was quite helpful.

  16. Dave Benson says:

    Thanks, man. Just what I was looking for…!

  17. Art says:

    Great. Short and to the point. Saved me from thrashing around.
    Thanks!

  18. Doug says:

    This was a great writeup on the very thing I was looking to do, thank you for the great help.

Leave a Reply