Reputation: 56914
I have a project in Eclipse, MyProject/
, that I want to share and import into my SVN repo:
MyProject/
src/
dist/
lib/
...etc.
Ultimately, I want to end up with an SVN repo for this project that looks like this:
svn://mySVNrepo/
MyProject/
trunk/
src/
dist/
lib/
branches/
tags/
But when I right-click MyProject
and select Team >> Share
, and follow the prompts, I end up with:
svn://mySVNrepo/
MyProject/
src/
dist/
lib/
So it's: (1) not allowing me to create trunk, branches and tags dirs, and (2) not allowing me to "nest" my imported project into trunk.
I then tried to create the directories manually from the SVN Repo Explorer view, and created:
svn://mySVNrepo/
MyProject/
trunk/
branches/
tags/
Then, I tried to share my project at:
svn://mySVNrepo/trunk
When I try to run this initial import, I get a warning from Eclipse:
Warning: The specified folder already exists in the repository. If you continue, that folder will be checked out to your local workspace and your project will be connected to this existing location. Do you want to continue?
So I ask: is my approach wrong, and if so, how can I commit my project for the first time into a trunk/
subdirectory? And if my approach is correct, then please help me decipher this warning message and advise on what I should do. Thanks in advance!
Upvotes: 3
Views: 5737
Reputation: 1141
After one hour of trial and error, I just did the following:
Upvotes: 0
Reputation: 2137
From the menu, select Window > Open Perspective > SVN Repository Exploring
Right click your repository > New Project Structure > Single project or multiple projects layout > enter 'MyProject' for the Name. This will create the new project with the /trunk/branches/tags/
project structure.
Once it's created, right click the Project and select Checkout.
'MyProject' should now be in your Navigator View. From there you can copy your /src
/dist
and /lib
folders into 'My Project' trunk folder.
Right click your Project and select Team > Commit.
EDIT:
You can also try the Subversive plugin for Eclipse. This plugin has an easier way to share your existing projects to svn as a multiple project layout (trunk/branches/tags
folder structure).
I posted the steps in a similar thread.
Upvotes: 2
Reputation: 845
One approach that would work is to keep your manually created trunk/branches/tags directories in SVN. Check out the empty /trunk into a parallel directory on your local workstation (Let's say directory #2, with your local project as #1). Then copy your project + code from #1 into that /trunk directory and commit to SVN.
Then you can make a 3rd directory locally, and check-out your SVN copy and ensure it compiles/runs properly. If so you can delete the intermediate #1/#2 directories, or keep your initial project as a backup just incase (but it'll be non-versioned). Then continue to use directory #3 as your new SVN monitored workspace.
If I'm unsure how my changes will affect work that I don't want to lose, I try to take an approach like this so the least amount of harm is done to my code if something goes wrong (say with a SVN command/operation I'm unfamiliar with, etc).
Upvotes: 2