SVN: How to create a proper branch from "unrelated" files
I am new to Subversion, and I am still working on the initial setup of one of my repositories based on a good deal of pre-existing code. I am using the traditional nomenclature of "trunk", "branches", and "tags".
I essentially have a folder (backend) that has a number of php files that drive a live production site, and a folder (backend_dev) that has a variation of the same files that power a development version of the site.
I would like to initially set my repository up such that /trunk/php/ contains my files from "backend_dev" and /branches/live-site/php/ contains the files from "backend". The problem is that I would like to somehow tell subversion to properly handle my branch as a branch, but because the branch does not actually have a historical relationship with the trunk, the most simple svn merge usage does not seem to be able to handle the situation.
Is there a way to do this? If not, what is ideology I should follow to handle a situation where I have开发者_运维知识库 multiple (manual) versions of pre-existing code.
To be clear, what I have tried is to svn import my "backend_dev" folder to /trunk/php and svn import my "backend" folder to /branches/live-site/php and use svn merge to see if the branch would operate properly.
I'd suggest importing the production code into trunk, branching it, and then replacing it with the development version in trunk (making any additions and deletions as needed) and committing.
That way, the resulting history will look as if you'd started with the production code, branched it, and then made some changes in trunk to arrive at the devel version — which presumably (hopefully) more or less matches actual reality.
精彩评论