Skip to content
Versora

Manual

Branches and remotes

Tags

4 min read

On this page

A tag marks a commit with a fixed name, usually a version (v1.4.0). Unlike a branch, it doesn't move along with new commits. There are two kinds:

  • lightweight tag: just a name pointing to the commit;
  • annotated tag: also keeps a message, author and date. It's the recommended one for published versions.

Tags are in the left panel's TAGS section and show up as labels in the graph.

Create a tag

Where to find it

  • A commit's menu: Create tag here… and Create annotated tag here….
  • A branch's menu (local or remote): the same items, at the end of the menu. The tag goes on the commit at the tip of the branch.
  • The graph's ghost branch: the tag icon next to the name field (see Graph).
  • To produce the whole version (changelog, manifests, commit and tag), use New version… (see Hygiene and flow).

Step by step

  1. Right-click the commit and choose Create annotated tag here….
  2. The Create annotated tag dialog shows the commit ("At 3f2a9c1").
  3. Fill in Tag name (for example, v1.4.0) and Tag message (required for an annotated tag).
  4. Click Create.

The tag is created only on your machine. For others to see it, push it (see below).

FieldLightweight tagAnnotated tag
Tag namerequiredrequired
Tag messagedoesn't show uprequired

What Versora does in git

bash
git tag v1.4.0 3f2a9c1                               # lightweight tag
git tag -a v1.4.0 -m "Version 1.4.0: monthly report" 3f2a9c1   # annotated tag

How to undo

Ctrl+Z undoes "Create tag v1.4.0": the local tag is removed.

The tag menu

Right-click a tag (TAGS section or a label in the graph). The menu has:

ItemWhat it does
Check out the commit at v1.4.0Checks out the tag's commit, in detached HEAD (see Checkout). Double-clicking the tag does the same.
Create branch here…Creates a branch from the tag (for example, hotfix/1.4.1).
Push v1.4.0 to › origin (or all remotes)Sends the tag.
Delete v1.4.0 locallyDeletes the tag only on your machine.
Delete v1.4.0 from remote › origin (or all remotes)Deletes the tag on the server. The local tag stays.
Create release on GitLab… (or on GitHub…)Creates the release of a tag that's already on the server (see Hygiene and flow).
Browsing the files, exporting a ZIP, Compare v1.4.0 with…See Inspection.
Copy tag name and Copy Versora link to tag: v1.4.0Copy the name or a versora:// link to the tag.

The all remotes submenu only shows up when the repository has more than one remote. With no remote, the push and remote deletion items are disabled.

Push a tag

Pushing a branch doesn't send the tags. Send each tag from its menu.

Step by step

  1. In the tag's menu, choose Push v1.4.0 to › origin.
  2. The bar shows "Pushing tag…".
  3. At the end, "Pushed tag v1.4.0 to origin" shows up.

What Versora does in git

bash
git push origin refs/tags/v1.4.0
# "all remotes": the same command for each remote

Delete a tag

Only on your machine

Delete v1.4.0 locally deletes the tag without asking. Ctrl+Z undoes "Delete tag v1.4.0" and the tag comes back. A fetch brings the tag back if it still exists on the remote (Versora's fetch gets the tags).

bash
git tag -d v1.4.0

On the remote

  1. Choose Delete v1.4.0 from remote › origin.
  2. If the remote's push rules forbid deleting tags, the Delete tag v1.4.0 on the remote? dialog opens first explaining the rule, with Delete anyway (see Push rules).
  3. The Delete v1.4.0 from remote dialog warns: "Tag "v1.4.0" will be deleted on origin for everyone. The local tag isn't affected."
  4. Click Delete from remote. At the end, "Deleted tag v1.4.0 from origin" shows up.
bash
git push origin --delete refs/tags/v1.4.0

Ctrl+Z doesn't bring the tag back to the server. If the local tag still exists, push it again.

Find a tag

  • The left panel's TAGS section. With many tags, the section shows the first 300 and says "+N more tags — use the filter to find them": type in the panel's filter (Ctrl+Alt+F).
  • Palette (Ctrl+P): type tag and the name. Choosing the tag selects its commit in the graph. A tag beyond the loaded commits shows up as unavailable.
  • Hover over the tag's label in the graph to see the annotation (message, author, date and whether it's signed). See Graph.

Caveats and messages

  • Git refuses to create a tag with a name that already exists: choose another name or delete the old one.
  • Moving a tag that has already been published disrupts whoever already fetched it. Prefer creating a new version.
  • The TAGS section can be hidden in the graph from the header menu ("Hide all tags").
  • The deny_delete_tag push rule (on GitLab or in .versora/push-rules.json): makes Versora warn before deleting a tag on the remote.

See also