How to properly create an SVN tag from trunk?

前端 未结 9 1589
挽巷
挽巷 2021-01-29 17:04

I am creating my first project in Subversion. So far I have

 branches
 tags
 trunk

I think I immediately need to make branches singular and sta

相关标签:
9条回答
  • 2021-01-29 17:55

    @victor hugo and @unwind are correct, and victor's solution is by far the simplest. However BEWARE of externals in your SVN project. If you reference external libraries, the external's revision reference (whether a tag, or HEAD, or number) will remain unchanged when you tag directories that have external references.

    It is possible to create a script to handle this aspect of tagging, for a discussion on that topic, see this SO article: Tagging an SVN checkout with externals

    0 讨论(0)
  • 2021-01-29 17:57

    As noted by @victor hugo, the "proper" way is to use svn copy. There is one caveat though. The "tag" created that way will not be a true tag, it will be an exact copy of the specified revision, but it will be a different revision itself. So if your build system makes use of svn revision somehow (e.g. incorporates the number obtained with 'svn info' into the version of the product you build), then you won't be able to build exactly the same product from a tag (the result will have the revision of the tag instead of that of the original code).

    It looks like by design there is no way in svn to create a truly proper meta tag.

    0 讨论(0)
  • 2021-01-29 18:00

    Just use this:

    svn  copy  http://svn.example.com/project/trunk  
               http://svn.example.com/project/branches/release-1
               -m  "branch for release 1.0"
    

    (all on one line, of course.) You should always make a branch of the entire trunk folder and contents. It is of course possible to branch sub-parts of the trunk, but this will almost never be a good practice. You want the branch to behave exactly like the trunk does now, and for that to happen you have to branch the entire trunk.

    See a better summary of SVN usage at my blog: SVN Essentials, and SVN Essentials 2

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