grgit-tag

Name

grgit-tag - Create, list, or delete tag object

Synopsis

grgit.tag.list()
grgit.tag.add(name: <name>, pointsTo: <commit>, force: <boolean>,
  annotate: <boolean>, message: <msg>, tagger: <person>)
grgit.tag.remove(names: [<name>, ...])

Description

grgit.tag.list()

Returns a list of tags (Tag).

grgit.tag.add(name: <name>, pointsTo: <commit>, force: <boolean>, annotate: <boolean>, message: <msg>, tagger: <person>)

Creates a new tag named <name> pointing at <pointsTo>. Returns the created Tag.

grgit.tag.remove(names: [<name>, …​])

Removes one or more tages. Returns a List<String> of tag names removed.

Options

add

name

(String, default null) Name of the tag

message

(String, default null) Use the given <msg> as the commit message.

tagger

(Person, default null) Override the tagger recorded in the tag. This must be a Person.

annotate

(boolean, default true) Make an unsigned, annotated tag object

force

(boolean, default false) Replace an existing tag with the given name (instead of failing)

pointsTo

(Object, default null) Point new tag at this commit. For a more complete list of acceptable inputs, see grgit-resolve (specifically the toRevisionString method).

remove

names

(List<Object>, default []) Names of the tags. For a more complete list of acceptable inputs, see grgit-resolve (specifically the toTagName method).

Examples

To list all tags.

def tags = grgit.tag.list()

Add an annotated tag.

grgit.tag.add(name: 'new-tag')
grgit.tag.add(name: 'new-tag', message: 'Some message')
grgit.tag.add(name: 'new-tag', annotate: true)

Add an unannotated tag.

grgit.tag.add(name: 'new-tag', annotate: false)

Add a tag starting at a specific commit.

grgit.tag.add(name: 'new-tag', pointsTo: 'other-branch')

Overwrite an existing tag.

grgit.tag.add(name: 'existing-tag', force: true)

Remove tags.

def removedTags = grgit.tag.remove(names: ['the-tag'])

See Also