How are tags made in Subversion?

后端 未结 6 2433
庸人自扰
庸人自扰 2021-02-19 08:30

I know how to use tags in subversion. I create a tag every time I get to a release milestone.

What I don\'t quite understand is how they work.

Is a tag just a c

相关标签:
6条回答
  • 2021-02-19 08:45

    The Subversion book is online in a complete and free form: http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.branchmerge.tags

    And yes, you basically do an svn copy. Subversion is smart enough to do a copy-on-write style mechanism to save space and minimize transfer time.

    0 讨论(0)
  • 2021-02-19 08:46

    The TortoiseSVN help explains it quite nicely:

    Subversion does not have special commands for branching or tagging, but uses so-called “cheap copies” instead. Cheap copies are similar to hard links in Unix, which means that instead of making a complete copy in the repository, an internal link is created, pointing to a specific tree/revision. As a result branches and tags are very quick to create, and take up almost no extra space in the repository. [...] If you modify a working copy created from a branch and commit, then all changes go to the new branch and not the trunk. Only the modifications are stored. The rest remains a cheap copy.

    0 讨论(0)
  • 2021-02-19 08:50

    A tag is a reference to the set of revision numbers at the time the tag was taken- it's the same thing as a branch or a copy, internally.

    0 讨论(0)
  • 2021-02-19 08:54

    Right, a tag is just a copy:

    svn copy trunk tags/BLAH
    

    When people say SVN doesn't really copy anything, they mean that the repository doesn't need to duplicate the data. It uses something akin to symbolic links to keep track of the copies.

    0 讨论(0)
  • 2021-02-19 09:00

    an example:

    $ svn copy https://jorgesysgr.com/svn/AndNews/branches \
               https://jorgesysgr.com/svn/AndNews/tags/release-1.1 \
               -m "release 1.1 Android News."
    

    More info:: Creating a Simple Tag

    0 讨论(0)
  • 2021-02-19 09:02

    Yes, a svn copy (whether you are thinking of it as a tag, a branch, or copying a file in trunk) is all the same. SVN will internally create a pointer to the source location at that revision. If you then make changes to the copy (which you are likely to do if it is a branch or a copied file in trunk, but shouldn't do for tags), SVN will only store what was changed, rather than creating a whole new copy.

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