Associating existing Eclipse project with existing SVN repository
Asked Answered
M

7

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

Marlonmarlow answered 16/2, 2010 at 14:28 Comment(1)
Which Subversion plug-in are you using? Subclipse? Subversive?Brahmin
D
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.

Dissipate answered 16/2, 2010 at 14:38 Comment(7)
yeah the trouble is I don't seem to have any .svn dirsMarlonmarlow
Ah yes, in that case there is nothing for subclipse to work with. A fresh import is the only option.Dissipate
This is exactly what I needed, thanks! An option under "Team" when right-clicking on a project would make this much more clear.Captor
Also, make sure your subclipse version and Subversion version are compatible before you use the Team > Share Project option subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuABroadsword
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.Sfumato
Tss, always stackoverflow with the answer and the question. Better than a manual :-)Troop
Perfect, Thanks for solution :)Vane
C
20

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

Consistory answered 17/1, 2014 at 18:50 Comment(1)
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 backIncorporeal
I
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

Incisure answered 2/4, 2013 at 14:13 Comment(0)
B
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.

Bales answered 7/4, 2016 at 15:46 Comment(0)
N
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

Nicholas answered 15/7, 2016 at 7:26 Comment(1)
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?Chit
L
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.

Lemar answered 17/2, 2010 at 11:3 Comment(0)
K
0

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

Kermes answered 22/7, 2015 at 6:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.