grgit-tag
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, defaultnull) Name of the tag - message
-
(
String, defaultnull) Use the given <msg> as the commit message. - tagger
-
(
Person, defaultnull) Override the tagger recorded in the tag. This must be a Person. - annotate
-
(
boolean, defaulttrue) Make an unsigned, annotated tag object - force
-
(
boolean, defaultfalse) Replace an existing tag with the given name (instead of failing) - pointsTo
-
(
Object, defaultnull) Point new tag at this commit. For a more complete list of acceptable inputs, see grgit-resolve (specifically thetoRevisionStringmethod).
remove
- names
-
(
List<Object>, default[]) Names of the tags. For a more complete list of acceptable inputs, see grgit-resolve (specifically thetoTagNamemethod).
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'])