C.22 GitPullTask
Prev | Appendix C. Optional tasks | Next

## C.22 GitPullTask

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

Table C.23: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`gitPath` | `String` | Path to Git binary | /usr/bin/git | No
`repository` | `String` | Path to Git repository | n/a | Yes
`all` | `Boolean` | Fetch all remotes | `false` | No
`source` | `String` | The "remote" repository that is the source of a fetch or pull operation. See <repository> in git-pull. | origin | Yes, if allRemotes set to false
`refspec` | `String` | See <refspec> in git-pull. | n/a | No
`strategy` | `String` | Merge strategy. One of "resolve", "recursive", "octopus", "ours", or "subtree". See <strategy> in git-pull. | n/a | No
`strategyOption` | `String` | Pass merge strategy specific option through to the merge strategy. See <strategy-option> in git-pull. | n/a | No
`rebase` | `Boolean` | See --rebase in git-pull. | `false` | No
`norebase` | `Boolean` | See --no-rebase in git-pull. | `false` | No
`tags` | `Boolean` | Enable tag references following. See --tags in git-pull. | `false` | No
`notags` | `Boolean` | Disable tag references following. See --no-tags in git-pull. | `false` | No
`keepFiles` | `Boolean` | See --keep in git-pull. | `false` | No
`append` | `Boolean` | See --append in git-pull. | `false` | No
`quiet` | `Boolean` | Quiet, suppress feedback messages. See --quiet in git-pull. | `false` | No
`force` | `Boolean` | Force update. See --force in git-pull. | `false` | No

### 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}" />

    <!-- 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" />

Prev | Up | Next
C.21 GitMergeTask | Home | C.23 GitPushTask