Editing
Archive
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Branches and Tags== Usually you develop in the "trunk" of a project. However, suppose you want to make some large changes that you might be working on for weeks, and not disrupt other people. In this case, you can use a "branch", which is a copy of the trunk. All your changes get committed to the branch, and do not affect the trunk. Once you are happy with that state of your branch, you can merge it back into the trunk. A "tag" is certain revision of the software that you want to "freeze". Of course, svn will let you recover any particular revision, but a tag is a special revision, perhaps a known stable one that is given a version number. In SVN, branches and tags are simply copies of the trunk that by convention go into the directories "branches" and "tags". Don't worry that you might be consuming a lot of disk space by making copies of the trunk - svn makes "lazy" copies - only the actual changes are saved. (If you've used CVS, you'll notice that branches and tags are different - and simpler - in SVN; they are just normal copies.) Here is how you might make a branch of vtkMy named 'merge_vtkMy-lite': svn copy https://mike.kin.ucalgary.ca/svn/bonelab/trunk/vtkMy https://mike.kin.ucalgary.ca/svn/bonelab/branches/merge_vtkMy-lite Similarly for a tag: svn copy https://mike.kin.ucalgary.ca/svn/bonelab/trunk https://mike.kin.ucalgary.ca/svn/bonelab/tags/version_2.2.0 Notice that for a tag, you should always copy ALL of the trunk. For branches, how much you copy is up to you. There is no harm in copying the whole trunk, even if you only want modify one little part in your branch. This doesn't consume and additional disk space because svn makes "cheap" copies, for which only changes are saved. Merging a branch back into the trunk can be slightly tricky. I recommend that you read the relevant section of the SVN Book: http://svnbook.red-bean.com/en/1.5/svn.branchmerge.html . If you have any doubt, come see Eric. Here is the command actually used to merge the above example (merge_vtkMy-lite) back into the trunk. In this case, once I was finished modifying the 'merge_vtkMy-lite' branch and had committed all the changes, I checked out a copy of the trunk, then from the working copy of the trunk, this was the command: svn merge --reintegrate https://mike.kin.ucalgary.ca/svn/bonelab/branches/merge_vtkMy-lite After you've merged a branch back into the trunk, you should delete it: svn rm https://mike.kin.ucalgary.ca/svn/bonelab/branches/my_great_new_feature This way, only currently active branches show up in the current revision, and it doesn't get cluttered with hundreds of old branches that are not interesting anymore. Note that the branch is not really gone, since nothing ever is truly deleted from svn. Anyone can checkout or otherwise access the particular range of revisions corresponding to between the times the branch was created and when it was deleted.
Summary:
Please note that all contributions to bone.wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BoneWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
associated-pages
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Documents
Recent changes
Help
Tools
What links here
Related changes
Page information