Tags

From Gcube Wiki
Jump to: navigation, search

Creating Tags

Git supports two types of tags: lightweight and annotated. In gCube we use lightweight tags to mark a specific point in the repository’s history.

The following command creates a tag on the last commit in the current branch:

$ git tag <tagname>

Late Tags

Tags can be created anytime in the project's history.

Suppose your commit history looks like this:

$ git log --pretty=oneline
15027957951b64cf874c3557a0f3547bd83b3ff6 Merge branch 'experiment'
a6b4c97498bd301d84096da251c98a07c7723e65 beginning write support
0d52aaab4479697da7686c15f77a3d64d9165190 one more thing
6d52a271eda8725415634dd79daabbc4d9b6008e Merge branch 'experiment'
0b7434d86859cc7b8c3d5e1dddfed66ff742fcbc added a commit function
4682c3261057305bdd616e23b64b0857d832627b added a todo file
166ae0c4d3f420721acbb115cc33848dfcc2121a started write support
9fceb02d0ae598e95dc970b74767f19372d61af8 updated rakefile
964f16d36dfccde844893cac5b347e7b3d44abbc commit the todo
8a5cbc430f1a9c3d00faaeffd07798508422908a updated readme

Now, suppose you forgot to tag the project at v1.2, which was at the “updated rakefile” commit. To tag that commit, you specify the commit checksum (or part of it) at the end of the command:

$ git tag v1.2 9fceb02

Pushing Tags

You will have to explicitly push tags to a shared server after you have created them.

$ git push origin <tagname>

Released Tags

It is strongly recommended to create a release from each tag in Gitea.

This is an example of release created in the gXRest repository starting from the tag v1.1.1:

Git releases server.png

The list of commits' messages since the previous release tag serves as releases notes for v.1.1.1.

Tagged releases can be also downloaded from Gitea.

Rules

  • We tag only the master branch
  • Tags are used to mark releases
  • Tags are applied after the related gCube release is declared closed
  • The tag name must be in the format "vX.Y" or "vX.Y.Z" (where X,Y,Z are follow the versioning schema major.minor[.build])


Back to the CI guide.