Wow you already here? Have you already read:
Kewl! So, now you are ready to add projects to Subversion using Subclipse and eclipse.
If you have Subversion (SVN) installed on a remote machine, you’ll need the IP address of that machine. If you have Subversion installed on your local machine then say ‘bring it on baby‘ and remember 127.0.0.1 that’s localhost by the way!
Now fire up our darling Eclipse! Go to Window –> Open Perspective –>Other –> SVN Repository Exploring
Here is the pic where SVN Repository would be.
Double Click and open the SVN Repository Exploring perspective. On the left portion of the screen there is white space. Right click there and click New–>Repository Location…
This opens up a popup box where you have to enter a URL to Add SVN Repository.
If you remember, I asked you to get the remote machine’s IP or the local machine’s IP. Type svn://18.104.22.168 or svn://xxx.xx.xx.xxx (Remote machines IP Address). Now Click finish.
You might get this error:
“No connection could be made because the target machine actively refused it.
svn: Can’t connect to host ‘22.214.171.124’: No connection could be made because the target machine actively refused it. ” Exactly like thisin red color in the console. Don’t freak out and break the computer or get emotional and sit in a corner and weep 🙁
Nothing drastic happened, you just forgot to start your Subversion Server !
Fire it up and add the SVN repository again … weeeeeeeeeeeee ! yep you got it! You are the King!
Half of the work is done!
Now we need to add a project, to the repository we just added.
|Switch back to ‘Dynamic Web Project‘ view. If you already have projects in your workspace, well and good. Otherwise first create/add some projects to your workspace.
Then, right click on the project you would like to add to Subversion repository and click on Team and then Share Project…
Select SVN, give the url, create a new repository location if you want to, change the folder name if you want to, Edit the commit comment to something you’ld remember and understand.
You will be prompted to enter the system login password first and then username and password
The username and password should match one in the passwords file(passwd) in the conf folder.
Now you have your project in the ‘Team Synchronizing mode”, but it has not yet been committed and hence is not yet in the repository.
In order to commit the project or specific files to the repository, just right click on that file or file system and click commit. It opens a new popup where you can write a comment depending on what requirement changes and when you are committing a specific file.
Notice that all folders and files that are not yet committed with have a black arrow with a + on them.
Double Clicking any file in the Team Synchronizing mode will open it and the original copy of that file in the repository, so you can easily compare and see what all changes you have made. If there is a two way arrow that is red in color, then there is a conflict as someone else has changed the file while you were seriously working on it. Get a stick and spank him/her! Damn it. Say shooot.
Here we will have to use the concept of merging.
Double-click the file to get a compare editor, and copy-paste what you need to resolve onto your local copy. When you have the local copy finished, right-click on the file and choose Mark as Merged. Well obviously, before you merge with your crappy code and overwrite the file on the repository’s head, I think it is a better idea to cross check and see if everything is fine!
The more often we update/sync our code, the less hassles of mergin will we have to face.
Hopefully this series, was helpfull for you.
In case you would like to read all the early posts in this topic.
They are all listed here: