简体   繁体   中英

How do I start a new project in Eclipse and Subversion

A newbie question (I haven't really created new projects in Eclipse yet): I have a machine running Linux with a fresh install of Eclipse 3.5.2. I want to create a new Java project in an existing subversion repository (which already contains some unrelated stuff). So after running Eclipse I get this dialog to specify workspace. What is the best practise here? Should it be in subversion? Then when I created a random one, when I add a project it goes into the workspace. So if my workspace is not in subversion, where and how should I get these projects there?

Background: probably I will work on my own on this project, however I have 2 PC's which I want to be able to use interchangeably.

What I usually do is put the workspace out of the way in ~/.workspace (invisible directory). Then I create new projects outside of that workspace, in the Subversion checkout directory.

You can create a project outside the workspace as follows:

  • Create a directory in your Subversion repository. Your project will live in this directory.
  • In Eclipse, click File; New; Project.
  • Choose the desired project type; click Next.
  • Instead of "Create new project in workspace" (the default), select "Create project from existing source". The name is misleading: the source does not have to exist, just the directory!
  • Click Browse and select the directory that you just created.

Eclipse will create a .project file and other support files in the directory you specified. Simply add all these files to Subversion, and you're all set.

Your workspace is the folder where eclipse will place all of your projects.

Basically, once you've linked Eclipse with a SVN repository, retrieving a SVN project will send him to the workspace, thus allowing you to work on it. Once you've made the changes, you can right click on your project in the project bar (on the left, by default) and chose ->team/subversion (depending on the eclipse version) -> commit.

If you want to send a project into your subversion, you create a new project inside your workspace. Then, you right click on the project in your project bar and do the same thing.

let's say that your workspace dir is /home/grzenio/workspace and your project name is project

first of all, go to to /home/grzenio/workspace , then checkout the source code, so the code will be at /home/grzenio/workspace/project .

Open eclipse, and create a new project from the folder selecting " Create project from existing source ". Select /home/grzenio/workspace/project

Voilá!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM