Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reorganise svn folder structure Tortoise

I have an SVN repository named 'Solution' (contains many projects) created without the default trunk, branch etc structure. I'd like to move this to the recommended structure.

I have created the new folder structure on the server where 'Team' is the root containing aforementioned trunk and branches. So should I relocate locally to Team/Trunk or copy locally and Add to the new repo folders? I'd like to maintain history in the process, if possible.

I have read a number of SO posts on this theme, but it seems there are many ways of getting this right or wrong, depending on circumstances.

Also, I'm new to SVN and development in general, hence I need GUI instructions as opposed to command line, please, sorry to be non-developer about it. Doing my best.

Illustration:

(Existing)
    Solution/
            Project folders/

(Proposed)
    Team/
            Trunk/
                 /Project folders
            Branches/
like image 801
Rufyan Avatar asked Aug 19 '13 02:08

Rufyan


People also ask

Where is TortoiseSVN config file?

If you open the TortoiseSVN's Settings dialogue, in section General, you'll find: global ignore pattern: and a corresponding edit line. the label Subversion configuration file: and an [Edit] button behind it, which opens (as for version 1.9. 5) the file %APPDATA%\Subversion\config in your preferred text editor.

How do I find my svn path?

http:// or https:// This is svn over http or https. You need to find the virtual host in your apache configuration and look for a <Location> section that matches your url path and look for a SVNPath or SVNParentPath config line. This will tell you the location of your subversion repository.

Can I move svn folder to another location?

Moving files and folders select the files or directories you want to move. right drag them to the new location inside the working copy. release the right mouse button. in the popup menu select Context Menu → SVN Move versioned files here.


1 Answers

Firstly, you do not need to create an entirely new repo in order to reorganize your projects.

Secondly, if you can, checkout the entirety of your Solution repo somewhere, and create and svn add the branches, tags, trunk folders. Do NOT commit them yet; you will svn move every other folder (the project folders) into trunk and then commit everything in one go.

To illustrate, I created a SampleRepo, checked it out, then svn added and svn committed a few placeholder project folders:

Initial repo folder structure

Then, I created the branches, tags, and trunk folders at the root of the repo checkout, then svn added them using TortoiseSVN:

SVN Add Option in TortoiseSVN

The repo checkout now looks like this:

The repo checkout after adding the branches tags trunk folders

Now, I select all of the project folders, and right-drag them over to the trunk folder, selecting SVN Move versioned item(s) here:

TortoiseSVN's svn move option

The root of the SampleRepo folder now contains just the branches, tags, and trunk folders. If you right-click any whitespace in the SampleRepo folder, and select TortoiseSVN -> SVN Check for modifications, you should see something like this:

The status of the repo checkout after the svn move

Finally, I right-click any whitespace in the SampleRepo folder, and choose TortoiseSVN -> SVN Commit..., add a commit message, and click OK.

Now, if I right-click any whitespace in the SampleRepo folder -> TortoiseSVN -> SVN Show log I will see this:

The log of the repo

All done!

NB: The reason I asked for a complete checkout of the repo is because then you can minimize the number of commits you'd have to make in order to achieve the restructuring you want. You can perform the restructure server-side using TortoiseSVN's Repo Browser, but then you'd need to commit every folder move, one at a time.

More reading:

  • Version Control with Subversion
  • TortoiseSVN's Help File, usually found here: %SYSTEMDRIVE%\Program Files\TortoiseSVN\bin\TortoiseSVN_en.chm
like image 148
Sameer Singh Avatar answered Sep 28 '22 14:09

Sameer Singh