trying to set up tortoise svn - newbie question

2020-02-29 11:47发布

问题:

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?

回答1:

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.



回答2:

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.)



回答3:

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.



回答4:

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

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