Reputation: 6904
I just created a brand new local subversion repository (c:\svnrepo) with the following steps:
mkdir c:\svnrepo
Opened c: in Explorer, right-clicked \svnrepo, and selected TortiseSVN->Create Repository Here
Had TortiseSVN create the default directories.
Now... I have two existing projects that I want to move into the repository. Let's call them "mylib" and "myapp". If it makes things easier, I can create a separate repo for each project instead of dumping both of them into different subdirectories of one big repo.
mylib is an IntelliJ project. It's a Java library, and currently inhabits c:\src\mylib
myapp is an Android Studio project. It's an Android app, and currently inhabits c:\src\myapp
Now is the point where I'm struggling. I used to know how to do this with my eyes closed, but it's been a few years since the last time I've had to create my own local Subversion repo from scratch, and I've basically forgotten how to do it. Plus, the last time I did it, I was using Netbeans (Java), Eclipse (Android), and SyncroSVN.
I vaguely remember that the procedure goes something like this:
Import the project (say, c:\src\mylib) into the local Subversion repo, add all the files, and commit them... but first, configure subversion to exclude all the files and directories that shouldn't be under VCS. I'm pretty sure there's a convenient way to do this in both IntelliJ 14 and Android Studio... but I don't know what it is (the last time I did anything like this, I was using Eclipse and SyncroSVN). At this point, I'm not even sure which directories and extensions SHOULD be excluded, because every online tutorial I find seems to have a different opinion (compounded by the radical changes Android Studio has made to its project directory structure with seemingly every single major new release).
Move c:\src\mylib and c:\src\myapp to c:\backup for safekeeping, then from c:\src, check out mylib and myapp from the Subversion repo. Once again, I'm pretty sure IntelliJ 14 and Android Studio both have a workflow to do this all in a single step, but I don't know what it is.
In theory, after I've done steps 1 and 2, I should be able to reopen the projects using IntelliJ or Android Studio, and the only difference is that they should both now be aware that the projects are under version control & somehow visually indicate files that differ from the repository copies.
What's the current proper way to do the steps above to get my two projects under Subversion control?
I have the following installed:
Just to be clear, I remember that there are two ways to organize a Subversion repo... either as a single monolithic project where the actual Java/Android projects are subdirectories of trunk, tags, and branches... or as separate repositories with one project apiece (each of which has its own trunk, tags, and branches). Either structure is fine with me. I just feel like I'm going in circles right now & desperately need a few nudges in the right direction.
Upvotes: 0
Views: 282
Reputation: 30662
First of all, install Subversion server on your machine. You could use http(s) URLs instead of awkward file:// access schema.
In any case, here are the steps that should work in Android Studio and IDEA both:
file:///C:/svnrepo/
or https://svn.example.com/svnrepo/
and select the project structure you need.Upvotes: 2