Tagging » History » Version 4

« Previous - Version 4/23 (diff) - Next » - Current version
Herbert Greenlee, 12/18/2014 10:11 AM

Tagging a branch for release

Releases are built from the master branch. This recipe shows how to create a tag on the master branch of a git repository. A similar procedure is used by the larsoft team to tag larsoft packages.

A preliminary step will be to get your local copy of the branch that will be the source of the tag (such as the develop branch) the way you want the released version to be.

First, get your local copies of develop and master branches up to date with the main repository.

cd $MRB_SOURCE/<package>
git checkout develop
git pull
git checkout master
git pull

Then update master with changes from develop or other source branch.

git merge develop

At this point, you can make further changes to your master branch, including the version number of the package being tagged and version numbers of dependent products, both stored in product_deps. After making all updates, it is a good idea to do a full test build, including tests.

mrb i -j4
mrb t -j4

When you are done updating master, commit and push your changes to the main repository.
cd $MRB_SOURCE/<package>
git commit
git push origin master

Now make the actual tag and push the tag to the main repository.

git tag -a -m"v02_05_01" v02_05_01   # Annotated tag.
git push origin v02_05_01            # Or git push --tags

If you want to move an existing tag, you need to add option -f or --force to the last two commands.

If you made changes directly on the master branch, like updating the version number in product_deps, you should merge these back into the develop branch.

git checkout develop
git merge master
git push origin develop