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

<p>What I don't quite understand is how they work. </p>

<p>Is a tag just a copy, made from what ever revision I specify? Or is a tag more like a reference, where internally subversion just says <code>GO TO /trunk/project/ Revision 5</code> or whatever.</p>

<p>The command to create a tag (<code>svn copy</code>) seems to imply that it's a copy, but I've seen other people write that subversion doesn't really copy anything.</p>

<p>Say I dump just the HEAD revision of a repository. I don't care about any history except the tags. Are those tags dumped along with the rest of the Head revision?</p>

<p>Finally, is all this just programming magic that I don't really want to know.</p>

[{'answer_id': 39980, 'author': 'Chris Conway', 'author_id': 1412, 'author_profile': 'https://Stackoverflow.com/users/1412', 'pm_score': 2, 'selected': False, 'text': "<p>Right, a tag is just a copy:</p>\n\n<pre><code>svn copy trunk tags/BLAH\n</code></pre>\n\n<p>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.</p>\n"}, {'answer_id': 39984, 'author': 'Tim Howland', 'author_id': 4276, 'author_profile': 'https://Stackoverflow.com/users/4276', 'pm_score': 1, 'selected': False, 'text': "<p>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.</p>\n"}, {'answer_id': 39990, 'author': 'nsanders', 'author_id': 1244, 'author_profile': 'https://Stackoverflow.com/users/1244', 'pm_score': 2, 'selected': False, 'text': '<p>The Subversion book is online in a complete and free form:\n  <a href="http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.branchmerge.tags" rel="nofollow noreferrer">http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.branchmerge.tags</a></p>\n\n<p>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.</p>\n'}, {'answer_id': 40003, 'author': 'pkaeding', 'author_id': 4257, 'author_profile': 'https://Stackoverflow.com/users/4257', 'pm_score': 5, 'selected': True, 'text': "<p>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.</p>\n"}, {'answer_id': 18407691, 'author': 'Jorgesys', 'author_id': 250260, 'author_profile': 'https://Stackoverflow.com/users/250260', 'pm_score': 0, 'selected': False, 'text': '<p>an example:</p>\n\n<pre><code>$ svn copy https://jorgesysgr.com/svn/AndNews/branches \\\n           https://jorgesysgr.com/svn/AndNews/tags/release-1.1 \\\n           -m "release 1.1 Android News."\n</code></pre>\n\n<p>More info:: <a href="http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html" rel="nofollow">Creating a Simple Tag</a></p>\n'}, {'answer_id': 21315419, 'author': 'Christian', 'author_id': 2018047, 'author_profile': 'https://Stackoverflow.com/users/2018047', 'pm_score': 2, 'selected': False, 'text': '<p>The <a href="http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-branchtag.html" rel="nofollow">TortoiseSVN help</a> explains it quite nicely:</p>\n\n<blockquote>\n  <p>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.\n  [...]\n  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.</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/39977', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/30/']