Subversion branching without having canonical directory structure

*爱你&永不变心* 提交于 2019-12-11 12:02:56

问题


I have a subversion repository, and I would like to create a branch, but the repository does not have the canonical directory structure of /trunk, /branches and /tags - it just has everything that should be in /trunk, in the root folder.

Am I screwed, or is there some way to correct the directory structure (or to create a branch within the existing directory structure)?


回答1:


Try something along the lines of

$ svn mkdir $REPO/{trunk,tags,branches}
$ for f in $(svn ls $REPO |grep -v 'trunk/$\|tags/$\|branches/$'); do
`   svn mv "$f" $REPO/trunk
` done
$ svn cp $REPO/trunk $REPO/branches/branch0



回答2:


Branch in svn is just a reference to a revision (that looks and acts like a complete copy).

So as long as you need to copy all your current trunk somewhere - you have to move all the files from root to subdirectory. Otherwise you have no valid points to copy your files to.

Moving to subdirectory can be performed as creating general directory and copying all the files and directories from the root via svn cp file by file and directory by directory.



来源:https://stackoverflow.com/questions/6728155/subversion-branching-without-having-canonical-directory-structure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!