Branching and Tagging


If you want to make large changes to the source tree, it may take sometime. While you are making changes, other people will not want to work on the same source tree because they may interfere with your changes. This is a waste of other people's time. In order to avoid this problem, you can use branching capability of svn.

Branching is a way to make a copy of a source tree in a repository. For example, if you want to make a large modification of trunk/mif/IFOmodel, you can create a copy of trunk/mif/IFOmodel to branches/mif/IFOmodel by the following command.

svn copy

Before issuing the above command, you have to make sure that branches/mif/ exist. If not, run the following command first,

svn mkdir --parents

After making a copy in the branches directory, you can checkout myIFOmodel and start making changes. Since myIFOmodel is a copy of the original, you can experiment with it as much as you want without interfering with other people working on the original IFOmodel.

Once you are done with your changes with myIFOmodel, you can merge your changes back to the original IFOmodel using svn merge command. Of course merging may not work right away because your changes to myIFOmodel may be incompatible with the current revision of IFOmodel. Here, manual human intervention is necessary to resolve conflicts.


Tagging is technically identical to branching in SVN. However, it is useful to distinguish branching and tagging in human mind. Tagging is used when you want to store the current status of the source tree as a snapshot. For example, if you used the current version of IFOmodel to create plots for a presentation at an LCGT f2f meeting. Then you can tag the current revision as

svn copy

IFOmodel-2011-2-f2f is an exact copy of the current IFOmodel. You can actually use it as a branch of IFOmodel. But as a convention, you don't touch it. Then the status of IFOmodel-2011-2-f2f is preserved. If someone want to reproduce the plots for this f2f meeting later, he/she can check-out IFOmodel-2011-2-f2f and run the codes inside.

Tagging is a way to take snapshots of the code development. Because svn always keeps track of the changes, tagging is in principle not necessary (you can rollback to anytime you want). Nonetheless, it is convenient to give a human readable name to a snapshot, rather than a number, like revision 4821.

LCGT/SVN/BranchTag (last edited 2021-06-03 16:22:35 by Ken-ichi Oohara)