C.23 GitTagTask

Create, list, delete or verify a tag object signed with GPG. See official documentation.

Table C.24: Attributes

NameTypeDescriptionDefaultRequired
gitPathStringPath to Git binary/usr/bin/gitNo
repositoryStringPath to Git repositoryn/aYes
messageStringUse given tag message. See -m of git-tag n/aNo
nameStringTag namen/aYes
commitString<commit> argument to git-tagn/aNo
objectString<object> argument to git-tagn/aNo
patternString<pattern> argument to git-tagn/aNo
outputPropertyStringProperty name to set with output value from git-tagn/aNo
fileStringTake tag message from given file. See -F of git-tag n/aNo
annotateBooleanMake unsigned, annotated tag object. See -a of git-tag falseNo
forceBooleanReplace existing tag with given name. See -f of git-tag falseNo
deleteBooleanDelete existing tags with given names. See -d of git-tag falseNo
listBooleanList tags with names matching given pattern. See -l of git-tag falseNo
numIntegerSpecifies how many lines from the annotation, if any, are printed when using -l. See -n of git-tag n/aNo
containsStringOnly list tags containing specified commit. See --contains of git-tag n/aNo
signBooleanMake GPG-signed tag. See -s of git-tag falseNo
keySignStringMake GPG-signed tag, using given key. See -u of git-tag of git-tag n/aNo
verifyBooleanVerify GPG signature of given tag names. See -v of git-tag falseNo

C.23.1 Example

<property name="repo.dir" value="./relative/path/to/repo" />
<resolvepath propertyName="repo.dir.resolved" file="${repo.dir}" />

<!-- clone repository -->
<gitclone
    repository="git://github.com/path/to/repo/repo.git"
    targetPath="${repo.dir.resolved}" />

<gittag repository="${repo.dir.resolved}" name="ver1.0" />
<!-- Force duplicate tag creation -->
<gittag
    repository="${repo.dir.resolved}"
    name="ver1.0" force="true"/>
<!-- Create tag with annotation and message -->
<gittag
    repository="${repo.dir.resolved}"
    name="ver1.0"
    annotate="true" message="Version 1.0 tag"/>
<!-- Delete tag -->
<gittag
    repository="${repo.dir.resolved}"
        name="ver2.0" delete="true" />
<!-- List tags matching to pattern "marked" into "tags" variable -->
<gittag repository="${repo.dir.resolved}"
    list="true"
    outputProperty="tags"
    pattern="marked" />