以下操作只会从主干的头版本创建一个分支。如何从特定修订版创建分支?感谢。
$ svn copy http://svn.example.com/repos/calc/trunk \
http://svn.example.com/repos/calc/branches/my-calc-branch \
-m "Creating a private branch of /calc/trunk."
答案 0 :(得分:159)
查看帮助命令:
svn help copy
-r [--revision] arg : ARG (some commands also take ARG1:ARG2 range)
A revision argument can be one of:
NUMBER revision number
'{' DATE '}' revision at start of the date
'HEAD' latest in repository
'BASE' base rev of item's working copy
'COMMITTED' last commit at or before BASE
'PREV' revision just before COMMITTED
使用您的示例在命令行上实际指定:
svn copy -r123 http://svn.example.com/repos/calc/trunk \
http://svn.example.com/repos/calc/branches/my-calc-branch
123
将是您要复制的中继中的修订号。正如其他人所说,您也可以使用@语法。我希望个人更清楚地将修订#与URL分开。
如帮助中所述,您也可以用某些单词替换修订版#:
svn copy -rPREV http://svn.example.com/repos/calc/trunk \
http://svn.example.com/repos/calc/branches/my-calc-branch
会在COMMITTED之前复制“修订版”。
答案 1 :(得分:33)
$ svn copy http://svn.example.com/repos/calc/trunk@192 \
http://svn.example.com/repos/calc/branches/my-calc-branch \
-m "Creating a private branch of /calc/trunk."
其中192是您指定的修订版
中找到此信息答案 2 :(得分:18)
使用“@”字符附加修订:
svn copy http://src@REV http://dev
或者,使用-r [--revision]命令行参数。
答案 3 :(得分:0)
尝试以下一项:
svn copy http://svn.example.com/repos/calc/trunk@rev-no
http://svn.example.com/repos/calc/branches/my-calc-branch
-m "Creating a private branch of /calc/trunk." --parents
svn网址之间不能使用斜杠“ \”。