tags:

views:

82

answers:

4

I want to move a file into a tag in svn, what is the best way to do this?

+4  A: 
svn copy /path/to/file/file.toadd /path/to/tag

Remember SVN doesn't really have a tag concept, so tags / branches can be modified

Owen
+5  A: 

The best way is not to do it. Tags are supposed to represent a snapshot at a particular point in time, so adding to them later doesn't make much sense. Tags cost almost nothing to make, so why not simply create a new tag with the added file?

anon
+1  A: 

It's not really nice to mess up a tag like that, but it's possible using svn commands with the full URL

svn cp \
  http://path/to/repository/trunk/path/to/your/file \
  http://path/to/repostory/tags/your-tag/path/to/your/file

You can use svn mv, svn rm etc. to get the desired effect.

amarillion
A: 

By "move", do you actually mean that you don't want it to continue existing where it is now? If so, and if you use the standard recommended layout for Subversion repositories, then an svn mv trunk/whateverfile tags/whateverfile would probably do it.

Otherwise, it's probably best to create a new tag that represents the current state of trunk.

calmh