Project

General

Profile

Tagging » History » Version 9

« Previous - Version 9/23 (diff) - Next » - Current version
Herbert Greenlee, 03/13/2015 02:11 PM


Tagging a branch for release (manual method)

Releases are built from the master branch. This recipe shows how to create a tag on the master branch of a git repository.

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. In particular, you may with to edit the following files.

  • ups/product_deps (all packages)
  • releaseDB/uboone.html.in (uboonecode)

After making all updates, it is a good idea to do a full test build, including tests.

cd $MRB_BUILDDIR
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

Tagging a branch for release (git flow release branch method)

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

Use git flow to create a release branch in your local repository. Git flow creates the release branch from the head of develop.

git flow release start v03_08_02 

After this command, the newly created release branch will be the checked out branch. At this point, you can make further changes to your release branch, including the version number of the package being tagged and version numbers of dependent products. In particular, you may with to edit the following files.

  • ups/product_deps (all packages)
  • releaseDB/uboone.html.in (uboonecode)

After making all updates, it is a good idea to do a full test build, including tests.

cd $MRB_BUILDDIR
mrb i -j4
mrb t -j4

When you are done updating the release branch, commit updates to your local repository.
cd $MRB_SOURCE/<package>
git commit

Use git flow to "finish" the release branch.

git flow release finish -m"v03_08_02" v03_08_02

This command does the following actions.
  • Merges release branch to master.
  • Merges release branch to develop.
  • Creates a tag on the master branch.
  • Deletes the release branch.
  • Checks out the develop branch.

Now push everything up to main repository.

git push origin develop master
git push v03_08_02                # Or git push --tags