In many projects, I check out the complete repository and have then the standard directory structure:
project/
branches/
tags/
trunk/
If I do an svn up project
, it's all fine with the branches
and trunk
folders, but, of course, the tags
folder is updated, too, and filled with (mostly) lots of tagged versions that are of no value for my work and only occupy disk space.
How can I except the tags
folder from an svn update
? Especially, how can I do this locally only, that is, without committing that back to the repository, as a solution with the svn:ignore
keyword would do?
A tag is just a “snapshot” of a project in time. In Subversion, this idea already seems to be everywhere. Each repository revision is exactly that—a snapshot of the filesystem after each commit. However, people often want to give more human-friendly names to tags, such as release-1.0 .
In SVN, tag is just a copy in /tags directory, so commiting is possible, but that's just an implementation detail. Nothing prevents you from commiting, but it's unusual, and people using the tag may be confused what exactly this tag represent ... original revision when tag was created or new changes.
There is no difference between branches and tags in Subversion. The only difference is in what the user then does with the directory. Branches are typically created, edited, and then merged back into the trunk. Alternatively, tags are created as a snapshot of the project at a point in time and then never changed.
Subversion has a feature called Sparse Checkout for this case.
svn up --set-depth empty project/tags
This will remove all checked out tags, leaving only the "tags" directory behind.
Another option is:
svn up --set-depth immediates project/tags
which will check out the tag directories itself, but not their content.
This way you can easily see new tags and get the contents of single tags with:
svn up --set-depth infinity project/tags/mytag
Edit:
This is working with elcucos solution, too and you can even use it for your branches directory.
First you check out the top of the project in non recursive way (-N or --non-recursive)
svn co https://server/project -N my_project_checkout
Now at this stage you can update only the trunk:
svn up my_project_checkout/trunk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With