C.13 GitCloneTask

Clone a repository into a new directory.

Table C.14: Attributes

NameTypeDescriptionDefaultRequired
gitPathStringPath to Git binary/usr/bin/gitNo
repositoryStringThe (possibly remote) repository to clone from.n/aYes
targetPathStringThe name of a new directory to clone into. Cloning into an existing directory is only allowed if the directory is empty.n/aYes
bareBooleanCreate bare repository. See --bare option of git-clone.falseNo
depthIntegerCreate a shallow clone with a history truncated to the specified number of revisions. See --depth option of git-clone.0No
singleBranchBooleanClone only one branch. See --single-branch option of git-clone.falseNo
branchStringCheckout branch instead of the remote's HEAD.n/aYes

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