11

I'd like to know a step-by-step procedure for a noob on how to create a hello world project in Eclipse that is Subversion/Mercurial/Git integrated. I know this is easy, but I am unsure how to do it.

I've:

  1. downloaded helios and put it on a local folder.
  2. created a new java project on directory "C:\workspace\tests".
  3. added a new Main.java file with a hello world message as it contents. The full filename is "C:\workspace\tests.java".
  4. now I'll want to change the "hello world" message to "bye world", but I'll want to be able to revert back to the previous message if needed. I need some kind of version control!

What are from this point on the baby-steps I must following to have this already created project and its files under subversion / git / mercurial version control? This shouldn't be about more complex matters, only how to add a simple existing project to source control on our own machine through eclipse!

Put the links to all the software that'll have to be installed, if you please. This is supposed to be a tutorial for total noobs at version control.

edit: i don't know how to make this CW. Could anyone do that?

Community
  • 1
  • 1
devoured elysium
  • 101,373
  • 131
  • 340
  • 557

2 Answers2

8

First you need the appropriate provider installed for your versioning system.

Then the first step from there is right-clicking on the project you want to put under version control, and choosing Team -> Share. What happens then is provider-dependent.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • 1
    Yes, it took me a long time to understand that what I wanted was Team->Share Project (I wonder why they didn't call it something that ressembles more to what it actually is -- Add Project to Source Control!). And from then on it works wonder for both git and mercurial eclipse plugins. But for subversion, it always asks me for some Host, and the file:/// thing doesn't work.. – devoured elysium Apr 06 '11 at 11:52
  • Okay, I right click on my project (in the Package Explorer), select "Team", and...nope, nothing that resembles "Share Project." Funny, I've done it before, but can't remember how (although the "Share" seems familiar). I've been using GIT and SVN, but now I'm confused. – SMBiggs Feb 24 '12 at 05:12
  • @ScottBiggs you need to be at the _root_ of the project, not a file or folder inside the project. – Thorbjørn Ravn Andersen May 25 '12 at 05:50
  • @ThorbjørnRavnAndersen: Thanks. I was trying to do this to a project that was *already* being shared! D'oh! For projects that have no version control, you are exactly right. – SMBiggs May 25 '12 at 14:37
1

Subclipse is a great plugin for Subversion.

Subclipse.tigris.org

You will need an existing Subversion client to use it.

I will assume you are using Windows based on your drive letter. Tortoise SVN is another good tool that you can use in Windows Explorer rather than inside of Eclipse. This is a more universal approach to Subversion.

tortoisesvn.net

I would personally recommend Git for version control, but I don't know of any good Eclipse plugins for it off the top of my head.

CalMlynarczyk
  • 705
  • 2
  • 7
  • 12
  • I've already installed tortoise AND tigris. Still I'd like to know how to add a project of my own to subversion source control.. – devoured elysium Apr 05 '11 at 17:56
  • Do you have a repository set up on some sort of Subversion server? – CalMlynarczyk Apr 05 '11 at 17:58
  • As stated on the original post, I'm looking to just add a simple file in a simple folder to version control on my own machine. Nothing more. That is, no, I don't. – devoured elysium Apr 05 '11 at 17:59
  • I hope this link gives you what you are looking for. [link](http://blog.jayway.com/2009/04/03/setting-up-a-local-subversion-repository-to-use-with-your-eclipse/) – CalMlynarczyk Apr 05 '11 at 18:05
  • The procedure done by the guy at the link doesn't work here. The New repository dialog doesn't accept my folder "file:///D:/lixo/svntests" as input. – devoured elysium Apr 05 '11 at 18:09