开发者

Tortoise SVN does not give option to "Add to SVN"

I've created an SVN repository and added folders an开发者_JAVA技巧d added contents and Committed. No problem.

But when go to add a new folder (the others were on the P:\ drive, now I want to add our website which is on the C:\ drive) but Tortoise doesn't give me the option of Adding a folder. I have no idea why. Help file shows the instructions I'd expect ("right click on the folder you want to add and choose +Add...") but Add... isn't in the menu.

This is TortoiseSVN v 1.6.7.18415 (I'm about to update it but I was able to add folders before so I don't think this is just a bug, I think maybe I'm missing something obvious).


You need to connect that folder with the repository before it can be added to subversion. I believe you will need to start by using the "export" option to connect the folder with a particular repository. You will need to checkout the repository to that directory to connect it. Once subversion knows which repository that folder belongs too, you can add subfolders to the same repository with the "Add" command. Just for the record, I imagine this belongs on superuser.com


Clay,

Add isn't on the menu "TortoiseSVN" right-click menu when you click on the new folder on the C:\ driver because you are clicking on a folder that is outside of the repository. You need to click on a folder inside the repository on your P:\ drive.

I think you need to move the files over to one drive and have everything in one repository/folder.


The reason Tortoise doesn't give you an "add" option is because the folder you right-clicked on is not located inside an existing working copy. You can do one of two things.

  • Move it inside a working copy. For example if your working copy was at P:\Project and the website you want to add is in C:\Website, you could copy C:\Website to P:\Project\Website (or whatever location under P:\Project where you wanted it added to the repository). Then, when you right-click the new copy, you should see an Add option.
  • Use the Import command. Tortoise will prompt you for the path. Note this is the path of the repository (http://myhost.com/svn/MyProject/Website) not the path of the working copy (C:\Project\Website).


Make sure the folder you want to add doesn't already have a hidden .svn file in it. For example, it used to be part of another repository. If it has this file, delete it along with any that may be hiding in subfolders. Then right click on the parent folder and see if you can add it.


Just do one step as it worked for me. From the P drive where you are doing the normal operations, copy the hidden folder with name ".svn" (in folder options make sure hidden folders are appearing) and paste it inside your C drive folder which you want to add. Now click on this folder you want to add an "add" will start appearing for it.


Add will only be available on direct subfolders of your working copy folders. It sounds like the folder you want to add is not within your working copy at all. If that's the case, the best solution is to move the folder within the working copy, then it will be available.

Another option is to create the folder, blank, on the repository directory and then checkout just that folder to where you want it. Then you can copy the files in and TortoiseSVN will give you an Add option on the contents.


  1. Right click folder and select "import..."
  2. URL of Repository: example: file:///SVNRepo/{Your Folder Name}
  3. Click OK (This creates a folder in your repository)
  4. Right click folder and select "SVN Checkout..."
  5. Make sure both the URL of Repository and Checkout Directory end with your folder name
  6. Click OK (This links your local folder with the repository folder)
  7. If your folder is not empty, it's ok, it will not delete anything. Checkout into the non empty folder.

That's it. Now your folder has the .svn file and is linked to your repository. You should have the "Add" option now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜