'svn: tagging a specific file in the repository

I want to tag a specific file. I know that this is possible with svn copy, and it is also possible directly in the repository by using URLs

But what can I do if I want to have the path to the file in /tags, but the path to the file is not yet tagged, i.e. doesn't exist in /tags? "svn copy" complains about the not existing target path, and "svn add" does not work on URLs

The only way I see at the moment is tagging the complete branch, and afterwards removing everything but that specific file from the tag, or work with a local copy of the target branch and add the path there.



Solution 1:[1]

Argh. Found the answer myself.

svn copy --parents -m"comment" URL-to-branch/path/file URL-to-tag/path/file

does the trick.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dix