For my lone-programming projects, either work related or personal, I often create a Subversion (SVN) repository on my local machine. To interface with my repository, I use Subclipse, an Eclipse plug-in. Problem is every time I start a new project, I forget how to create a new SVN repository in Subclipse, and send ~1 hour googling. The key step that I always forget is that Subclipse can’t create repositories (the “Create a new repository location” option in Subclipse does not actually create a new repository), it can only do the initial import.
Assuming that you already have SVN, Eclipse and Subclipse installed:
- Form the terminal prompt, create an local repository. First create or cd into the directory you would like to house your repository, and then use svnadmin. Svnadmin will create a sub directory named after your project, and everything else svn needs.
svnadmin create projectName
(this is half of the first step from this tutorial). - In Eclipse, open the SVN Repositories View (Window»Show View»SVN Repositories or select from the “Other” dialog if not shown). Click on the icon with the plus sign to add a new repository location. For the url, place the path to the repository created in step 1, prefixed by file:///. (You can find the path to any directory using the pwd command in the terminal.)
- Create your project as usual in Eclipse. Do the inital import into SVN by right clicking on your project in the Package Explorer, and selecting Team»Share Project. Choose “SVN” and select your repository location.
- You can now commit files, revert and merge etc. with SVN through Subclipse.