94

I have an eclipse project on my hard disk, which is a fairly recent check out from an SVN repository. I've imported this project into my Eclipse workspace, and now want to associate it with the SVN repository.

How do I do this? The only options I seem to have under Right-click -> Team is "Share Project", which only seems to allow me to do an initial import.

Edit: Motivation - It's a largish repository, and I don't really want to have to import the whole thing over the network.

Edit 2: There are (for some reason) no .svn dirs in the project. So maybe a fresh import from svn is the only option

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Richard H
  • 38,037
  • 37
  • 111
  • 138

7 Answers7

147

Team->Share project is exactly what you need to do. Select SVN from the list, then click "Next". Subclipse will notice the presence of .svn directories that will ask you to confirm that the information is correct, and associate the project with subclipse.

amarillion
  • 24,487
  • 15
  • 68
  • 80
  • 1
    yeah the trouble is I don't seem to have any .svn dirs – Richard H Feb 16 '10 at 14:41
  • 2
    Ah yes, in that case there is nothing for subclipse to work with. A fresh import is the only option. – amarillion Feb 16 '10 at 20:05
  • 1
    This is exactly what I needed, thanks! An option under "Team" when right-clicking on a project would make this much more clear. – Ed Orsi Jul 26 '13 at 14:39
  • 2
    Also, make sure your subclipse version and Subversion version are compatible before you use the Team > Share Project option http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA – Alex Mar 18 '14 at 23:44
  • Ok and what if my svn location is not listed, project was checked out not by eclipse. create new SVN repo option does show dialog with creating new repo. – Stan May 02 '14 at 06:49
  • Tss, always stackoverflow with the answer and the question. Better than a manual :-) – Harald Dec 25 '14 at 18:00
  • Perfect, Thanks for solution :) – Snehal Masne May 02 '16 at 09:25
19

I just wanted to add that if you don't see Team -> Share project, it's likely you have to remove the project from the workspace before importing it back in. This is what happened to me, and I had to remove and readd it to the workspace for it to fix itself. (This happened when moving from dramatically different Eclipse versions + plugins using the same workspace.)

subclipse not showing "share project" option on project context menu in eclipse

Community
  • 1
  • 1
Marcus
  • 2,128
  • 20
  • 22
  • You're right, "Share project" was missing for me under "Team..." until I delete the project (not its content), then reimport it. "Share project" action is back – el-teedee Aug 26 '16 at 15:17
1

I'm asked this question very frequently, if it's smart to use "Share project..." if a eclipse project has been disconnected from it SVN counterpart in the repository. So, I append my answer to this thread.

The SVN-Team option "Share project ..." is totally fine for projects that exist in SVN and in your Eclipse workspace, even if the Eclipse project is missing the hidden .svn configuration. You can still connect them. Eclipse SVN-implementation (Subclipse/Subversive) will verify if the provided SVN http(s) source is populated. If yes, all existing files will be copied and linked (checked out in SVN terms) to your very personal Eclipse workspace.

Word of caution:

  • Do a backup if you depend on you local files. The SVN implementation may vary its behaviour with every release.
  • If you have multiple projects encapsulated within each other, make sure you point the SVN path to the correct local path.

regards, Feder

feder
  • 1,775
  • 5
  • 25
  • 36
1

I came across the same issue. I checked out using Tortoise client and then tried to import the projects in Eclipse using import wizard. Eclipse did not recognize the svn location. I tried share option as mentioned in the above posts and it tried to commit these projects into SVN. But my issue was a version mismatch. I selected svn 1.8 version in eclipse (I was using 1.7 in eclipse and 1.8.8 in tortoise) and then re imported the projects. It resolved with no issues.

Addy
  • 191
  • 1
  • 3
1

I am using Tortoise SVN client. You can alternativley check out the required project from SVN in some folder. You can see a .SVN folder inside the project. Copy the .SVN folder into the workspace folder. Now remove the project from eclipse and import the same again into eclipse. You can see now the project is now associated with svn

Kaliappan
  • 642
  • 9
  • 24
  • what will happen if I was using the code in eclipse that I had the checkout from tortoise before and make changes in code under Eclipse and want to have added svn to that project from eclipse like other checkout projects with svn. will be able to do that? – Indrajeet Gour May 29 '17 at 06:29
0

In case of SVN servers you have to creating a central repository with all projects. The contents of the repository can be uploaded with the Team/Share command; in case of the Subversive client it automatically runs a commit after the import, so you can upload your files.

This step cannot be circumvented in any way using a centralized version management system such as SVN.

Zoltán Ujhelyi
  • 13,788
  • 2
  • 32
  • 37
0

Try this- Close the project then open it. It links with svn automatically,if project was checked out from valid svn path.

takendarkk
  • 3,347
  • 8
  • 25
  • 37
Srashti
  • 49
  • 3