Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseSVN: Adding additional files after using SVN Checkout dialog "Only this item" option

Our department is planning on using the "SVN Checkout" option within Tortoise SVN. In that dialog, we select the "Only this item" option and then we click the "Choose items" button and choose all the relevant files we want to check-out. Let's assume a user will make a mistake, and forgot to check out an important file. What is the easiest way to go back and choose that file (or list of files) from trunk?

enter image description here

EDIT:

Suggested changes to @Chad's answer:

A.) If the parent folder of the folder(s) or file(s) you are checking out DOES NOT EXIST in the working copy, then do the following:

  1. Open a Repo-browser for the repository.
  2. Right-click the files that were missed and choose Checkout....
  3. Fix/Set the Checkout directory to where the files should go (add the folders from the folder you clicked to the parent folder of the folder/file you are checking out and make sure you are using backslash characters)
  4. Click OK.
  5. You will get a warning that the "Target folder is not empty". Go ahead and choose the Checkout into the non empty folder option.

The files will be added to the working copy.

DISCLAIMER: If you do not follow step #3, the working copy of the checked out files will be in a strange location not relative to the rest of the files.

B.) If the parent folder of the folder(s) or file(s) you are checking out DOES EXIST in the working copy, then do the following:

  1. Open a Repo-browser for the repository.
  2. Navigate to the parent folder of the file you intend to checkout (avoids the step of having to fix the "Checkout Directory")
  3. Right-click the files that were missed and choose Checkout....
  4. Click OK.
  5. You will get a warning that the "Target folder is not empty". Go ahead and choose the Checkout into the non empty folder option.

The files will be added to the working copy.

EDIT #2:

Suggested update to @gbjbaanb's proposed answer:

To include new folders/files to working copy:

  1. Right click root folder of checked out folder > select "TortoiseSVN" > select "Repo-browser"
  2. Enter credentials (if authentication is cleared in TortoiseSVN > Settings > Saved Data) > click "OK"
  3. Right click items in either the file explorer panel or the file detail panel within the Repository Browser dialog > select "Update item to Revision" > take all defaults in the Update to Revision dialog > click "OK"
  4. Enter credentials (if authentication is cleared in TortoiseSVN > Settings > Saved Data) > click "OK"

NOTE: Repeat step #3 and #4 for all new folders/files being added

DISCLAIMER: Assume you are only adding new folders or files to your working copy/checked out folder.

To exclude folders/files from working copy:

  1. Right click folder or file you wish to exclude
  2. Select Tortoise SVN > Update to Revision
  3. Click "Choose items..." button under the "Update Depth" section of the Update to Revision dialog
  4. Enter credentials (if authentication is cleared in TortoiseSVN > Settings > Saved Data) > click "OK"
  5. Uncheck relevant folder(s) or file(s) > click "OK"

That's the method I used with a very large repository. Only the bits I needed were checked out, when I needed them.

like image 684
MacGyver Avatar asked Oct 31 '13 14:10

MacGyver


People also ask

How do I checkout with TortoiseSVN?

Right click on the checked out folder, then use TortoiseSVN → Update to Revision and select Choose items.... This opens the same dialog that was available in the original checkout and allows you to select or deselect items to include in the checkout.

How do I checkout a file in svn?

So we right-click on this folder and select 'SVN Checkout…' From here we'll specify the location of the repository that we want to check our files out from. So something like… If you've forgotten what this URL is then you can go back to the VisualSVN server app and right click to select 'Copy URL to Clipboard'.

How do I update my TortoiseSVN repository?

To update, select the files and/or directories you want, right click and select TortoiseSVN → Update in the explorer context menu. A window will pop up displaying the progress of the update as it runs. Changes done by others will be merged into your files, keeping any changes you may have done to the same files.


2 Answers

You right-click on the root, select repo-browser, find the relevant bits you want to download to your working copy, right click and select the "update to revision".

To remove items you have downloaded, right click on the item in your working copy, select the same menu (update to revision) and select "exclude" from the depth box.

That's the method I used with a very large repository. Only the bits I needed were checked out, when I needed them.

like image 104
gbjbaanb Avatar answered Oct 04 '22 16:10

gbjbaanb


There are two scenarios when adding missed files and folders to a working copy: The Missing parent folder scenario and the Present parent folder scenario.

Scenario 1: The working copy is Missing the parent folder of the missed folders or files

  1. Open a Repo-browser for the repository.
  2. Right-click the files that were missed and choose Checkout....
  3. Set the Checkout directory to where the files should go. From an existing folder in the working copy, add the path of missing folders leading to the folder/files you are checking out. Make sure to use backslash characters.
  4. Click OK.
  5. You will get a warning that the "Target folder is not empty". Go ahead and choose the Checkout into the non empty folder option.

The files will be added to the working copy.

DISCLAIMER: If you do not follow step #3, the working copy of the checked out files will be in a strange location not relative to the rest of the files.

Scenario 2: The working copy Contains the parent folder of the missed folders or files

  1. Open a Repo-browser for the repository.
  2. Navigate to the parent folder of the file you intend to checkout (this avoids having to change the "Checkout Directory")
  3. Right-click the files that were missed and choose Checkout....
  4. Click OK.
  5. You will get a warning that the "Target folder is not empty". Go ahead and choose the Checkout into the non empty folder option.

The files will be added to the working copy.

like image 33
Chad Nouis Avatar answered Oct 04 '22 15:10

Chad Nouis