Explore tags
Git tags are references pointing to specific commit in the Git history. Tagging is used to capture a milestone in the Git history, generally to mark a version release (i.e. v1.0.1). The Git client makes it possible to tag a given commit with an arbitrary name. It is also possible - but not mandatory - to provide a description when tagging a commit.
Hackolade Studio started to support the creation of tags within the application with v8.1.0
Create a tag
In the Tags screen, the button to create a tag is always enabled. Clicking on it opens a bottom pane that renders the tag action parameters.
By default a newly created tag implicitly applies the latest commit, the Head of the active branch. If you want to create a tag for an earlier commit, it must be done from the history screen.
You must provide a name for the tag. It is mandatory. A common pattern is to use version numbers like v1.4.2. Note however that there are several restrictions to tag names. If possible, create tag names that don't contain special characters, as these would need to be escaped. A safe default set of characters to use for tag names is:
- The English alphabet (a to z and A to Z)
- Numbers (0 to 9)
- A limited set of punctuation characters:
- period (.)
- hyphen (-)
- underscore (_)
- forward slash (/)
To avoid confusion, you should start tag names with a letter.
When only a name is provided, the tag is said to be lightweight. It is just a pointer to a commit and it contains no additional metadata.
Specifying a description turns the tag into an annotated tag. Such a tag is materialized as a Git object that contains additional metadata such as the tag author and date. Note that it is possible to force the creation of an annotated tag without specifying a description.
You have the option to specify a description but it is optional. But best practice is to create annotated tags, as they embed interesting metadata.
You decide whether or not to push the tag to the remote repository. If the local repository has a remote, then that option must be enabled by default because we believe that it is the expected behavior in most cases. Deselecting the checkbox allows the user to create personal tags. If the local repository has no remote, then that option must be disabled and the checkbox must be hidden.
The button Create tag is always enabled. It starts by validating the form. It highlights the tag name with a red border if it is not filled in.
List existing tags
The tags are listed in a table.
There is a contextual menu for every tag.
* Show in history view redirects the user to the History view where the top filter Branch or Tag is set to the selected tag. We already do something similar to switch to the history of a file from the Files view.
* Review... opens the bottom pane with [the Review tab](tagging-commits.md#reviewing-a-tag) selected.
* Checkout... opens the bottom pane with [the Checkout tab](tagging-commits.md#checking-out-a-tag) selected.
* Delete... opens the bottom pane with [the Delete tab](tagging-commits.md#deleting-a-tag) selected.
* Push... opens the bottom pane with [the Push tab](tagging-commits.md#pushing-a-tag) selected. This menu item should only be rendered if the local repository has a remote. It should be hidden otherwise.
The user can search for a tag using the filter that is located on top of the table. Only the tags whose name match the search pattern are listed. If there is no tag matching the search pattern, then the placeholder below is rendered.
Review a tag
It is possible to review a tag by selecting it in the table or by clicking on Review... in the contextual menu.
Checkout a tag (TBA)
The Git client makes it possible to checkout a tag without creating a new branch. However, that command turns the local repository into detached HEAD state, which can be extremely misleading for the user. To avoid any kind of problems, we offer the option to checkout a tag but only as a new branch. This allows the user to use the tag as a starting point for making new changes (e.g. when working on a patch).
Push a tag (TBA)
It is possible to push a tag to the remote repository (assuming that it has not been pushed at creation time) by selecting it in the table or by clicking on Push... in the contextual menu.
The Push tab is hidden (as well as the corresponding entry in the contextual menu) if the local repository has no remote.
Delete a tag (TBA)
It is possible to delete a tag by selecting it in the table or by clicking on Delete... in the contextual menu.
By default, the tag is also deleted from the remote repository (like newly created tags that are pushed by default). However, the user can disable that option. A confirmation message must be displayed before executing the action.