public class CloneCommand extends TransportCommand<CloneCommand,Git>
credentialsProvider, timeout, transportConfigCallback
repo
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 |
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, setTransportConfigCallback
checkCallable, getRepository, setCallable
public Git call() throws GitAPIException, InvalidRemoteException, TransportException
Clone
command.call
in interface Callable<Git>
call
in class GitCommand<Git>
Git
object with associated repositoryInvalidRemoteException
TransportException
GitAPIException
public CloneCommand setURI(String uri)
uri
- the uri to clone frompublic CloneCommand setDirectory(File directory)
directory
- the directory to clone toURIish.getHumanishName()
public CloneCommand setBare(boolean bare)
bare
- whether the cloned repository is bare or notpublic CloneCommand setRemote(String remote)
Constants.DEFAULT_REMOTE_NAME
will be used.remote
- name that keeps track of the upstream repositoryConstants.DEFAULT_REMOTE_NAME
public 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)
NullProgressMonitor
monitor
- this
NullProgressMonitor
public CloneCommand setCloneAllBranches(boolean cloneAllBranches)
cloneAllBranches
- true when all branches have to be fetched (indicates wildcard
in created fetch refspec), false otherwise.this
public CloneCommand setCloneSubmodules(boolean cloneSubmodules)
cloneSubmodules
- true to initialize and update submodules. Ignored when
setBare(boolean)
is set to true.this
public 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
).this
public 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.this
Copyright © 2014. All rights reserved.