C.22 GitPushTask

Update remote refs along with associated objects. See official documentation.

Table C.23: Attributes

NameTypeDescriptionDefaultRequired
gitPathStringPath to Git binary/usr/bin/gitNo
repositoryStringPath to Git repositoryn/aYes
allBooleanPush all referencesfalseNo
destinationStringThe "remote" repository that is destination of a push operation. See <repository> in git-push.originYes, if allRemotes set to false
refspecStringSee <refspec> in git-push.n/aNo
mirrorBooleanSee --mirror in git-push.falseNo
deleteBooleanDelete "remote" reference. Same as prefixing the refspec with colon. See --delete in git-push.falseNo
tagsBooleanPush all references under refs/tags. See --tags in git-push.falseNo
quietBooleanQuiet, suppress feedback messages. See --quiet in git-push.falseNo
forceBooleanForce update. See --force in git-push.falseNo

C.22.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}" />

<!-- push branch "master" into "foobranch" on "origin" remote -->
<gitpush
    repository="${repo.dir.resolved}"
    refspec="master:foobranch" tags="true" />

<!-- create new branch "newbranch" on "origin" remote -->
<gitpush
    repository="${repo.dir.resolved}"
    refspec="master:newbranch" quiet="true" />

<!-- delete "newbranch" branch from "origin" remote -->
<gitpush
    repository="${repo.dir.resolved}"
    delete="true"
    refspec="newbranch" quiet="true" />