gritHEAD → docs/tag
Commands / Branches and tagsMarkdown

grit tag

List tags, or create or delete one. A new tag points at the current commit.

grit tag
grit tag <name>
grit tag -d <name>

Description

With no arguments, lists your tags. With a name, creates a tag pointing at the current commit; tags created by grit are lightweight tags, with no message of their own. With -d, deletes a tag.

Tag names must be valid as refs/tags/<name> under Git's ref-name rules (same checks as git check-ref-format refs/tags/<name>). Invalid names are rejected before writing under .git/refs.

Tags are local until you publish them with grit push --tags.

Options

Option Description
<name> The tag to create or delete. Omit to list tags.
-d, --delete Delete the tag.

JSON output

Pass --json for stable, scripting-friendly output. The object's action field says what happened:

Field Type Meaning
action string list, create, or delete.
tags array For list, each tag with name and oid.
name string For create or delete, the tag name.
oid string For create, full id of the commit the tag points at.