views:

1225

answers:

4

I am trying to set up an svn on my windows computer to keep track of versions. i've downloaded tortoise svn, but am confused how to install. i can't find a good simple answer for my problem, all the manuals are fairly complicated, so please don't tell me RTFM.

my problem is i set up a repository at C:\svn (using create repository here). Then I right click a folder containing my files and say import. I choose the repository "file://C:\svn" and then it gives me an errors saying "unable to open repository"

What should I do?

A: 

you need to checkout first, then add your files to the new working copy.

Also, try this for a url: file:///C:/svn

Luke Schafer
it gives me the same errors when i try to checkout and use that url
+2  A: 

Right-click where you want your working copy, and select "SVN checkout...". Select file:///C:/svn/trunk as your repository URL and checkout. Unless you've added files to your repo, you'll get an empty working copy. Any files you create in the working copy, you can add using the Tortoise context menu.

Import is typically used when you have a complete file tree you want to copy into your repository. Select the root of the file tree, and use "TortoiseSVN -> Import" from the context menu, and select file:///C:/svn/trunk as the target of the import. This will copy the file tree into the repository, so if you then checkout from file:///C:/svn/trunk, you'll get your file tree inside your working copy.

Hope that clears things up a little.

(The book Version Control with Subversion is otherwise an excellent resource, both for new users and for reference.)

JesperE
unfortunately after i tried svn checkout i got the same errors
to be more specific the errors are:Unable to open ra_local session to URL,Unable to open repository file 'file://C:/svn/trunk'Can't open file \\C:\svn\trunk. The filename, directory name or volume label syntax is incorrect
thanks for the book recommendation
+1  A: 

From your project directory (the one you want to move into your repository), right-click and select TortoiseSVN -> Import...

I think the problem is that you are only using 2 slashes for your file: URL. Try file:///C:/svn.

Also, from memory you can't import directly into a directory that already exists, so you might need to import into file:///C:/svn/trunk.

This won't make the current directory into a working copy. You'll need to go ahead and check out the project into another directory so that the connections between your project and SVN can be created.

Good luck.

Benny Hallett
thanksthat helped
+8  A: 

To start from scratch:

  • create the directory C:\svn - this will be where you store your repositories - one per project

  • using explorer, create a subdirector in that directory, we'll call it it "myproj"

  • using explorer open that directory - you should be looking at an empty explorer pane

  • right click on the empty pane, and from the Tortoise menu choose "create repository here". This creates a new empty repository in the "myproj" directory.

  • go up one level and right click on "myproj". From the Totrtoise menu select the "repo browser". We are going to use this to create the subdirectories that SVN likes to find in a repository

  • right click on the root of the displayed (empty) tree and choose "Create folder" from the menu. Then enter "trunk" (without quotes) and click OK. If you like, use the same process to create directories called "tags" and "branches" at the same level as "trunk".

  • select the newly created "trunk" folder and make a
    note of the file URL that appears at the top of the repo manager - in fact, copy it to the clipboard - it will look something like "file:///C:/svn/myproj/trunk"

  • now navigate to somewhere you want to do your work in - NOT the directory containing the source files you have already created, Right click and choose "Checkout" from the Tortoise menu. Enter the file URL you got in the previous step and click OK. This will checkout an empty prpject.

  • now copy all the existing files and directories that you have been working on into the new "myproj" project folder you just created via checkout (not the one in the repository)

  • in explorer, right click on the "myproj" folder and choose "commit" from the Tortoise menu. In the dialog that appears, check the "select all" box at the bottom and click OK. All the files and directories willbe added to the trunk and you are good to go - any changes you make to the "myproj" directory can be committed by selecting the directory in explorer, right clicking, and selecting "Commit" from the Tortoise menu.

anon
thanks, following ur detailed instructions fixed the problem