多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# C.17 GitCloneTask Clone a repository into a new directory. Table C.18:聽Attributes NameTypeDescriptionDefaultRequired`gitPath``String`Path to Git binary/usr/bin/gitNo`repository``String`The (possibly remote) repository to clone from.n/aYes`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/aYes`bare``Boolean`Create bare repository. See --bare option of [git-clone](http://www.kernel.org/pub/software/scm/git/docs/git-clone.html).`false`No`depth``Integer`Create a shallow clone with a history truncated to the specified number of revisions. See --depth option of [git-clone](http://www.kernel.org/pub/software/scm/git/docs/git-clone.html).`0`No`singleBranch``Boolean`Clone only one branch. See --single-branch option of [git-clone](http://www.kernel.org/pub/software/scm/git/docs/git-clone.html).`false`No`branch``String`Checkout `branch` instead of the remote's HEAD.n/aYes C.17.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" /> ```