I have an existing Java project in Eclipse:
MyProject/
src/
... all main sources
test/
... all test sources
build.xml
... lots of other stuff
I now want to add this project (commit all of it) to the empty trunk/
of a new SVN repo:
https://svn.example.com/MyProject/
trunk/
(Empty)
So that, after the commit, the repo now looks like:
https://svn.example.com/MyProject/
trunk/
src/
... all main sources
test/
... all test sources
build.xml
... lots of other stuff
I installed the Subclipse plugin.
In Package Explorer, I:
MyProject/
Team >> Share Project >> SVN >> https://svn.example.com/MyProject
https://svn.example.com/MyProject/trunk
When I do this, instead of committing all my source code (contained in MyProject
) to the trunk/
in the repo, it overwrites (thus a checkout) MyProject/
with an empty directory!
Thus, Share Project seems to be for checking out code from a repo, not committing new code into a repo for the first time!
How do I accomplish such an initial commit with the Subclipse plugin and/or Eclipse's Team features?
Share Project is the right option. However, you should let it create the trunk folder. What the process will do is run the svn mkdir command to create the trunk folder. It will then checkout that empty folder into your project (which does not impact your content at all). At this point, you now have a working copy which is the critical part. Obviously all of your project content still needs to be added. At this point your content will show as Unversioned. The process will launch the synchronize option to give you a chance to do this, though you can also just do it via the Team > menu option. You need to use Add to Version Control for everything you want to add, and then ultimately commit it. You can also choose to ignore some items if you want to be sure they are never committed.