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:

mkdir subversionRepository
cd subversionRepository
svnadmin create project1

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.

This Post Has 19 Comments

  1. Doug

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

  2. Art

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

  3. Dave Benson

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

  4. TudorD

    Yeah. Thanks, it was quite helpful.

  5. lynton

    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.

  6. Oded

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

  7. Rob

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

  8. Abhishek

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

  9. Enrique

    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.

  10. Amyne

    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

  11. Zach

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

  12. belal

    thanks for sharing , looking for this from long time

  13. jordi

    Great article! Thank you very much!

  14. xmichaelx

    Thank you for article! :)

  15. bob

    Thank you! Saved my time!

  16. Sherin

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

  17. pascal

    Thanks.

  18. Lee

    Thanks for this info!

  19. Ankit

    Tried searching for so many options to search for local Subversion with a intuitive UI. Version app was one of them, but that was paid app. This one just works out of the box perfectly, plus the integration with eclipse is epic. Thanks so much buddy. Keep up with your articles. In fact, I am now thinking of blogging, who knows, things that are implicit to you could be time saver for someone else!

Leave a Reply