Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Putting a project in Eclipse under source control

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?

like image 313
devoured elysium Avatar asked Apr 05 '11 17:04

devoured elysium


People also ask

What is source control in Java?

Version control, also known as source control, is the practice of tracking and managing changes to software code. Version control systems are software tools that help software teams manage changes to source code over time.

How do I commit an Eclipse project to Github?

Select Create... from the Configure Git Repository window and choose a folder for your local Git repo. Select Finish. Right-click your project in Project Explorer and select Team, Commit.... Stage your changes by dragging your files to the Staged Changes field, enter a commit message, then select Commit.

How do I import a Git project into Eclipse?

Copy the GitHub URL of the repository to the clipboard. Open Eclipse and choose Import –> Projects from Git (with smart import) Choose the Clone URI option in the Git import wizard and click Next. Confirm the URI, Host and Repository path parameters and click Next.


2 Answers

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.

like image 118
Thorbjørn Ravn Andersen Avatar answered Sep 16 '22 16:09

Thorbjørn Ravn Andersen


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.

like image 44
CalMlynarczyk Avatar answered Sep 16 '22 16:09

CalMlynarczyk