SaltyCrane Blog — Notes on JavaScript and web development

How to install Subversion (SVN) with Eclipse on Windows

Subversion looks to be the new version control system of choice in the open source community, supplanting CVS which supplanted RCS. This article, Why Subversion Over CVS, gives some reasons to choose Subversion over CVS. Many people also choose subversion over commercial products such as ClearCase and Visual Source Safe. The authors of "Windows Developer Power Tools" (O'Reilly 2006) write:

Subversion is our favorite version-control system, and we definitely recommend it above all others (including commercial products) in most scenarios. There may be certain areas where commercial systems excel, but for overall version control, it's tough to beat Subversion.

Step by step instructions

Here are my notes for installing Subversion, TortoiseSVN (a Subversion client which integrates with Windows Explorer), and Subclipse (the plugin for Eclipse integration) on Windows. This assumes you already have Eclipse installed. Also, these notes are geared towards version control for individual use as opposed to team use.

  1. Install Subversion and TortoiseSVN using SVN 1-Click Setup
    • Go to http://svn1clicksetup.tigris.org/, click "Download the latest version", run the installer, and accept all the defaults.
    • This is a Windows installer used "to simplify the process of setting up a Subversion repository on a Windows-based computer. Svn1ClickSetup takes a user through the steps necessary to install the Subversion command-line utilities and TortoiseSVN, as well as creating a repository and initial project." --from svn1clicksetup.tigris.org
    • To check that something went right, go to Windows Explorer and right-click on a file. You should see the "TortoiseSVN" context menu item.

  2. Install the Subclipse plugin using the instructions at http://subclipse.tigris.org/install.html.

  3. Define the SVN Repository
    • In Eclipse, from the "Window" menu, select "Open Perspective" > "Other...". Select "SVN Repository Exploring" and click "OK".
    • Inside the "SVN Repository" window, right-click in the big empty space, and select "New" > "Repository Location...".
    • In the "Url:" box, type "svn://localhost". Click "Finish". (Use this url to connect to the repository hosted on the SVN server on your local machine created using svn1clicksetup. I got this tip from http://james.cooley.ie/2006/12/01/version_control_with_eclipse_on_windows.html. If you want to use a repository on another server, then point to that location instead. "file://, http://, or https:// are the other protocols that can be used.)

  4. Add an Eclipse project to the repository
    • In the "Navigator" window, right-click on a project and select "Team" > "Share Project...".
    • Select "SVN" and click "Next"
    • Your repository, "svn://localhost", (which you added in step 3) should show up here. Click "Next".
    • Click "Next" again. Click "Finish". I got the following output in the "Console" window:
          Filesystem has no item
      svn: URL 'svn://localhost/my_project' non-existent in that revision
      
      mkdir -m "Initial import." svn://localhost/my_project
      checkout -N -r HEAD svn://localhost/my_project
          Checked out revision 5.
    • Select the files you want to add and click "OK". I got the following output in the "Console" window:
      add -N C:\path\to\my_project\test.py
          A         C:/path/to/my_project/test.py
      commit -m "Initial import." C:/path/to/my_project/test.py
          Adding         path/to/my_project/test.py
          Transmitting file data ...
          Committed revision 6.
    • See this article for more information: How to use Subversion with Eclipse

  5. Modify and commit a file
    • Edit one of the newly added files and save it.
    • In the "Navigator" window, right-click on the file, and select "Team" > "Commit...".
    • Enter a comment and click "OK". I got the following output in the "Console" window:
      commit -m "test" C:/path/to/my_project/test.py
          Sending        path/to/my_project/test.py
          Transmitting file data ...
          Committed revision 7.
      
  6. Show the history for a file
    • In the "Navigator" window, right-click on the file, and select "Team" > "Show History".
    • The "History" window should open showing the revisions of your file. Double-click on a revision to open it or right-click for other options.

Related posts:

Other resources

Comments


#1 Marnel J. Rodriguez commented on :

It work successfully on my local computer. If I were to access my SVN here from another computer connected in a LAN, how will I do it? Am I just going to type, http://ip_address/project_name ?

And can you also post how to create a subversion using Apache Server 2.2.x?

Thank you so much!


#2 Eliot commented on :

Marnel, I'm sorry I'm no longer using subversion or eclipse so I won't be able to answer your question. I hope you can find your answer elsewhere. Thanks for reading.


#3 Albert commented on :

A tutorial about how to install SVN plugin in eclipse: Very easy.

http://no-suelo.blogspot.com/2010/09/how-to-install-eclipse-svn.html

Regards


#4 chuck commented on :

works still on win7 64bit. had to get the 64bit of TortoiseSVN however. sweet. thanks.


#5 sushant verma commented on :

Thanks a lot, it really helped a lot.... though i used a pre-existing repository at file:///... but still finally i get it the way i wanted....

Really appreciate your effort...


#6 Majid commented on :

Awesome! Very clear instructions and easy to understand. I had never worked on Java before and hadn't even seen the Eclipse perspective,yet I was able to install and configure Subclipse in less than half an hour.

Thanks a lot man!


#7 Dmitry commented on :

Hey, fantastic guide. I didn't follow it exactly but it was easy to pick out the bits that I needed. Nice work.


#8 Div commented on :

Thanks very well documented!


#9 Mridul commented on :

thanks......Albert....


#10 Navaneetha Krishnan commented on :

Good job!!! I did configuration quickly as well as i could understand easily. Thanks a lot Albert....