svn : how to create a branch from certain revision of trunk

前端 未结 4 567
盖世英雄少女心
盖世英雄少女心 2020-12-22 18:40

The following action will only create a branch from the head revision of the trunk. How do I create a branch from a specific revision? Thanks.

$ svn copy ht         


        
相关标签:
4条回答
  • 2020-12-22 18:52
    $ 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."
    

    Where 192 is the revision you specify

    You can find this information from the SVN Book, specifically here on the page about svn copy

    0 讨论(0)
  • 2020-12-22 18:52

    Try below one:

    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
    

    No slash "\" between the svn URLs.

    0 讨论(0)
  • 2020-12-22 18:54

    Check out the help command:

    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
    

    To actually specify this on the command line using your example:

    svn copy -r123 http://svn.example.com/repos/calc/trunk \
        http://svn.example.com/repos/calc/branches/my-calc-branch
    

    Where 123 would be the revision number in trunk you want to copy. As others have noted, you can also use the @ syntax. I prefer the clearer separation of the revision # from the URL, personally.

    As noted in the help, you can replace a revision # with certain words as well:

    svn copy -rPREV http://svn.example.com/repos/calc/trunk \
        http://svn.example.com/repos/calc/branches/my-calc-branch
    

    Would copy the "revision just before COMMITTED".

    0 讨论(0)
  • 2020-12-22 19:04

    append the revision using an "@" character:

    svn copy http://src@REV http://dev
    

    Or, use the -r [--revision] command line argument.

    0 讨论(0)
提交回复
热议问题