C.10 GitArchiveTask

Create an archive of files from a named tree.

Table C.11: Attributes

NameTypeDescriptionDefaultRequired
gitPathStringPath to Git binary/usr/bin/gitNo
repositoryStringThe repository.n/aOne of these attributes is required.
remoterepoStringThe remote repository.n/a
treeishStringThe tree or commit to produce an archive for.n/aYes
outputStringWrite the archive to file.n/aNo
prefixStringPrepend prefix to each filename in the archive.n/aNo
formatStringFormat of the resulting archive: tar or zip. If this option is not given, and the output file is specified, the format is inferred from the filename if possible (e.g. writing to "foo.zip" makes the output to be in the zip format). Otherwise the output format is tarn/aNo

C.10.1 Example

<gitclone gitPath="${git-path}"
          singleBranch="true"
          repository="${repo.dir.resolved}"
          targetPath="${tmp.dir.resolved}/test" />
<gitarchive
        gitPath="${git-path}"
        repository="${tmp.dir.resolved}/test"
        treeish="HEAD"
        format="zip"
        output="${tmp.dir.resolved}/output.zip"
/>