tags:

views:

91

answers:

4

This is my first ever attempt at creating an svn repository and I'm confused.

I have a project in /var/www/project, and I have a /var/svn/ dir to store the repositories, so I run:

$ svnadmin create /var/svn/project

and I import my tree with

$ svn import /var/www/project file:///var/svn/project/trunk

so far so good -- I think

Now I need a working copy, but I can't checkout in my existing dir or I get

svn: Failed to add file 'some.file': an unversioned file of the same name already exists

am I supposed to delete the entire project tree and then check it out of svn? Also, is this the right way to set up a repository?

+4  A: 

you can rename the original project directory if you feel unsure, then check out to a new dir

davidosomething
Yeah, that's what I would do as well, or just check it out under a different name.
Michael Krauklis
Accepting this answer since I like to be super careful when doing this sort of things, but thanks to Michael Hackner for pointing out the `--force` option too
kemp
A: 

Yes, after you import a project to a repository, you have to perform a check out:

Note that after the import is finished, the original tree is not converted into a working copy. To start working, you still need to svn checkout a fresh working copy of the tree.

Be sure not to erase your original code to early, though.

Anton Gogolev
+1  A: 

Just check out to a new directory. You can always rename it later once you're sure.

futureelite7
+2  A: 

You can do

svn checkout --force file:///var/svn/project/trunk /var/www/project

This will allow you to checkout into your existing directory that you just imported from.

Michael Hackner