cloneRepository

fun cloneRepository(url: String, branch: String? = null, depth: Int? = null): ClonedRepositoryReference

Clone a Git repository from the given URL to a temporary directory. The returned object will expose tools.

Return

ClonedRepository with absolute path and cleanup capabilities

Parameters

url

The Git repository URL (supports both HTTP/HTTPS and SSH)

branch

Optional specific branch to check out (defaults to repository default)

depth

Optional shallow clone depth (null for full clone)

Throws

GitAPIException

if the clone operation fails