C.21 GitPullTask

Fetch from and merge with another repository or a local branch. See official documentation.

Table C.22: Attributes

NameTypeDescriptionDefaultRequired
gitPathStringPath to Git binary/usr/bin/gitNo
repositoryStringPath to Git repositoryn/aYes
allBooleanFetch all remotesfalseNo
sourceStringThe "remote" repository that is the source of a fetch or pull operation. See <repository> in git-pull.originYes, if allRemotes set to false
refspecStringSee <refspec> in git-pull.n/aNo
strategyStringMerge strategy. One of "resolve", "recursive", "octopus", "ours", or "subtree". See <strategy> in git-pull.n/aNo
strategyOptionStringPass merge strategy specific option through to the merge strategy. See <strategy-option> in git-pull.n/aNo
rebaseBooleanSee --rebase in git-pull.falseNo
norebaseBooleanSee --no-rebase in git-pull.falseNo
tagsBooleanEnable tag references following. See --tags in git-pull.falseNo
notagsBooleanDisable tag references following. See --no-tags in git-pull.falseNo
keepFilesBooleanSee --keep in git-pull.falseNo
appendBooleanSee --append in git-pull.falseNo
quietBooleanQuiet, suppress feedback messages. See --quiet in git-pull.falseNo
forceBooleanForce update. See --force in git-pull.falseNo

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

<!-- pull from all remotes -->
<gitpull
    repository="${repo.dir.resolved}" all="true" />

<!-- pull remote origin/foobranch and rebase when merging -->
<gitpull
    repository="${repo.dir.resolved}"
    source="origin" refspec="foobranch"
    strategy="recursive" keep="true"
    force="true" quiet="true" rebase="true" />