How to Import Existing Project Directory Into SVN Repository
You can import an existing project directory (with contents) into an SVn repository, and use the current location as your version controlled working copy.
Here is how to do it:
Suppose that your non-versioned project sources are in /home/user/aproject, and your repository is ready at http://server/repos.
First, create an empty directory somewhere outside of your project tree, say, /tmp/empty. Import that empty directory in your subversion repository.
cd /tmp/empty
svn import . http://server/repos/aproject
Then, go into your existing non-versioned project directory. Now checkout the repository location you created in step 1.
cd /home/user/aproject
svn checkout http://server/repos/aproject .
Do not forget the trailing dot at the previous command. This will add the .svn files to your existing project directory, but it will not do anything else, so your existing files are safe.
Next, add the directory with your files to the repository
svn add *
svn commit -m 'initial commit'
Done.



Recent Comments