C.15 GitCloneTask
Prev | Appendix C. Optional tasks | Next

## C.15 GitCloneTask

Clone a repository into a new directory.

Table C.16: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`gitPath` | `String` | Path to Git binary | /usr/bin/git | No
`repository` | `String` | The (possibly remote) repository to clone from. | n/a | Yes
`targetPath` | `String` | The name of a new directory to clone into. Cloning into an existing directory is only allowed if the directory is empty. | n/a | Yes
`bare` | `Boolean` | Create bare repository. See --bare option of git-clone. | `false` | No

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

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

Prev | Up | Next
C.14 GitInitTask | Home | C.16 GitGcTask