Suppose you are working on some brand new machine. You've just installed Eclipse and you want to get your source from the repository. It's easy. Just go to the SVN perspective and add the repository. Find your source and right click and choose checkout. Now you have the source on your local machine.
Next, you will want to save your changes. This you do by committing, though I think I already mentioned it. Another common thing you will want to do is get any new changes from the server. Suppose both you and a friend are working on the same project and you have been waiting for him to complete a particular class so that you can use it. Once he's finished and committed his changes, you can add them to your working copy of the source by going to the java perspective, right clicking on the project going to team and clicking UpdateToVersion.
Wednesday, July 21, 2010
Tuesday, July 20, 2010
The first, simplest thing to do in subversion is to add your code to the repository. To do this, go your Java perspective and right click the project you want to add to the repository. Go to Team and then choose Share Project. Once it is shared, you will not see it in the repository. You have to commit your changes, and everything you have written so far is a change. So go back to the Java perspective, right click on your project and go to Team/Commit. Now everything you have written in that project will be added to the repository.
So this is my first, technical computer sciency blog post. It concerns what is called a versioning system. A versioning system allows you to have access to a large, shared collection of written work (like programs, or documents) in such a way that any new additions are kept organized. For instance, appartently though I have not managed to do it yet, with a SVN like Subversion for Eclipse, if you make a change to your code it is saved but so is the old version. You can, theoretically, see all instances of the code back to its inception. If you want to undo a change, you simply go the version that does not include that change. In any case, this little blurb is actually about how to install the versioning system known as Subversion in Eclipse.
- Open Eclipse and go to Help/Install New Software
- Press Add to add a software repository
- See the box appear that asks for the URL...
- ...which you find here http://subclipse.tigris.org/ and go to Download and Install
- (On this page you will see official instructions for adding Subversion)
- Scroll down a bit to find the various urls and chose the newest one :1.6 (though it depends on the version of Eclipse you have).
- paste that url back into the box in Eclipse
- Choose all the available software to be installed and go forward until it starts installing
- Restart Eclipse
- Go to Window/Preferences and click on Team/SVN
- in the SVN interface chose (Pure Java).
- The configuration location should be default
- Go to Window/Open Perspective...other and click on SVN Repository and click OK.
- In the blank space in the SVN repositories view right click New/Repository Location where you will enter the location of your repository which you should get from your administrator.
- Give your password when prompted and this should complete the process.
- I fyou have any problems, you might solve them by deleting your entire Eclipse install and reinstalling the latest one