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, checkout master and get your local copy of master up to date with the main repository.
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 stored in product_deps. When you are done updating master, commit and push your changes to the main repository.
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
--forceto 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