Use tags
Tags specify significant points in a repository’s history such as releases and stable builds.
Guidelines for using tags
You can use the following tags:
Lightweight tags | Temporary or personal tags attached to a Git commit that you can quickly create and delete. They are stored as metadata with the corresponding changeset in Dimensions CM. |
Annotated tags | Used to identify project milestones such as when the application is ready for release. Annotated tags have a comment, creator, date, and timestamp. They are stored in Dimensions CM as baselines. |
- Only tags for changesets that are being cloned are created. For example, if you are cloning to a depth of three changesets (
--depth=3
), and the fourth oldest changeset has a tag, that tag is excluded from the fetch. - You cannot create annotated tags with topic streams.
For details about tags, see the Git documentation.
Create and push lightweight tags
You can use the Git Client to:
- Create lightweight tags.
- Push changes to Dimensions CM.
- Create new changesets.
- Store lightweight tag information as a property of a changeset.
Example:
-
Clone a stream:
Copy codegit clone dimensions://cmserver/cm_typical@dim14/qlarius/java_brancha_str .
-
Make changes to the code.
-
Commit the changes and create a lightweight tag called
mywork
:Copy codegit commit –a –m “comment for my changes”
git tag mywork -
Push the lightweight tag to Dimensions CM:
Copy codegit push origin mywork
The push
command:
- Delivers the code changes.
- Creates a new Dimensions CM changeset with the tag mywork.
Delete lightweight tags
You can remove lightweight tags from Dimensions CM changesets.
Example:
- Delete the lightweight tag locally in your Git repository:
- Push the tag deletion to Dimensions CM:
Create and push annotated tags
You can use the Git Client to:
- Create annotated tags.
- Push changes to Dimensions CM.
- Create new changesets.
-
Create new baselines of streams.
Note: The user pushing the annotated tag requires the appropriate Dimensions CM privileges to create baselines.
Example:
-
Clone a stream:
Copy codegit clone dimensions://cmserver/cm_typical@dim14/qlarius/java_brancha_str .
-
Make changes to the code.
-
Commit the changes and create an annotated tag called rel2.1:
Copy codegit commit –a –m “comment for my changes”
git tag –a rel2.1 –m “ready for release” -
Push the annotated tag to Dimensions CM:
Copy codegit push origin rel2.1
The push
command:
- Delivers the code changes.
- Creates a new Dimensions CM changeset.
- Create a new baseline of the stream at that point in time.
The annotated tag name is used as the baseline identifier, for example: QLARIUS:REL2.1
Delete annotated tags
You can delete annotated tags from Dimensions CM. If you delete a baseline directly from Dimensions CM using a client, the annotated tag is also deleted.
Note: The user pushing the annotated tag requires the appropriate Dimensions CM privileges to create baselines.
Example:
-
Delete the annotated tag locally in your Git repository:
Copy codegit tag –d rel2.1
-
Push the tag deletion to Dimensions CM:
Copy codegit push --delete origin rel2.1
This command deletes the baseline QLARIUS:REL2.1 from Dimensions CM.
List tags
Git has multiple methods to list tags and display the commits related to a tags. All methods are supported by the Dimensions CM Git Client.
Examples:
-
To list lightweight and annotated tags:
git tag –l
-
To list all tags and the commits the tags point to:
git show-ref --tags
-
To show the details for a specific tag:
git show rel2.1