public class CloneCommand extends TransportCommand<CloneCommand,Git>
credentialsProvider, timeout, transportConfigCallbackrepo| Constructor and Description |
|---|
CloneCommand()
Create clone command with no repository set
|
| Modifier and Type | Method and Description |
|---|---|
Git |
call()
Executes the
Clone command. |
CloneCommand |
setBare(boolean bare) |
CloneCommand |
setBranch(String branch) |
CloneCommand |
setBranchesToClone(Collection<String> branchesToClone) |
CloneCommand |
setCloneAllBranches(boolean cloneAllBranches) |
CloneCommand |
setCloneSubmodules(boolean cloneSubmodules) |
CloneCommand |
setDirectory(File directory)
The optional directory associated with the clone operation.
|
CloneCommand |
setGitDir(File gitDir) |
CloneCommand |
setNoCheckout(boolean noCheckout) |
CloneCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the clone operation.
|
CloneCommand |
setRemote(String remote)
The remote name used to keep track of the upstream repository for the
clone operation.
|
CloneCommand |
setURI(String uri) |
configure, configure, self, setCredentialsProvider, setTimeout, setTransportConfigCallbackcheckCallable, getRepository, setCallablepublic Git call() throws GitAPIException, InvalidRemoteException, TransportException
Clone command.
The Git instance returned by this command needs to be closed by the
caller to free resources held by the underlying Repository
instance. It is recommended to call this method as soon as you don't need
a reference to this Git instance and the underlying
Repository instance anymore.call in interface Callable<Git>call in class GitCommand<Git>Git object with associated repositoryInvalidRemoteExceptionTransportExceptionGitAPIExceptionpublic CloneCommand setURI(String uri)
uri - the uri to clone frompublic CloneCommand setDirectory(File directory)
directory - the directory to clone toIllegalStateException - if the combination of directory, gitDir and bare is illegal.
E.g. if for a non-bare repository directory and gitDir point
to the same directory of if for a bare repository both
directory and gitDir are specifiedURIish.getHumanishName()public CloneCommand setGitDir(File gitDir)
gitDir - the repository meta directoryIllegalStateException - if the combination of directory, gitDir and bare is illegal.
E.g. if for a non-bare repository directory and gitDir point
to the same directory of if for a bare repository both
directory and gitDir are specifiedpublic CloneCommand setBare(boolean bare) throws IllegalStateException
bare - whether the cloned repository is bare or notIllegalStateException - if the combination of directory, gitDir and bare is illegal.
E.g. if for a non-bare repository directory and gitDir point
to the same directory of if for a bare repository both
directory and gitDir are specifiedpublic CloneCommand setRemote(String remote)
Constants.DEFAULT_REMOTE_NAME will be used.remote - name that keeps track of the upstream repositoryConstants.DEFAULT_REMOTE_NAMEpublic CloneCommand setBranch(String branch)
branch - the initial branch to check out when cloning the repository.
Can be specified as ref name (refs/heads/master),
branch name (master) or tag name (v1.2.3).public CloneCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitormonitor - thisNullProgressMonitorpublic CloneCommand setCloneAllBranches(boolean cloneAllBranches)
cloneAllBranches - true when all branches have to be fetched (indicates wildcard
in created fetch refspec), false otherwise.thispublic CloneCommand setCloneSubmodules(boolean cloneSubmodules)
cloneSubmodules - true to initialize and update submodules. Ignored when
setBare(boolean) is set to true.thispublic CloneCommand setBranchesToClone(Collection<String> branchesToClone)
branchesToClone - collection of branches to clone. Ignored when allSelected is
true. Must be specified as full ref names (e.g.
refs/heads/master).thispublic CloneCommand setNoCheckout(boolean noCheckout)
noCheckout - if set to true no branch will be checked out
after the clone. This enhances performance of the clone
command when there is no need for a checked out branch.thisCopyright © 2015 Eclipse JGit Project. All rights reserved.