/** * Return a command object to execute a {@code clone} command * * @see <a href= * "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html" * >Git documentation about clone</a> * @return a {@link org.eclipse.jgit.api.CloneCommand} used to collect all * optional parameters and to finally execute the {@code clone} * command */ public static CloneCommand cloneRepository() { return new CloneCommand(); }
/** * Returns a command object to execute a {@code clone} command * * @see <a * href="http://www.kernel.org/pub/software/scm/git/docs/git-clone.html" * >Git documentation about clone</a> * @return a {@link CloneCommand} used to collect all optional parameters * and to finally execute the {@code clone} command */ public static CloneCommand cloneRepository() { return new CloneCommand(); }
/** * Return a command object to execute a {@code clone} command * * @see <a href= * "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html" * >Git documentation about clone</a> * @return a {@link org.eclipse.jgit.api.CloneCommand} used to collect all * optional parameters and to finally execute the {@code clone} * command */ public static CloneCommand cloneRepository() { return new CloneCommand(); }
private void cloneBaseTemplates(Path configTemplatesDir) throws Ap3Exception { try { String prefix = "cloning base templates... "; PrintWriter pw = new PrintWriter(System.out); pw.write(prefix); pw.flush(); SingleLineProgressMonitor pm = new SingleLineProgressMonitor(pw, prefix); CloneCommand cloneCommand = new CloneCommand(); cloneCommand.setDirectory(configTemplatesDir.toFile()); cloneCommand.setURI("https://bitbucket.org/atlassian/ap3-sdk-templates.git"); cloneCommand.setProgressMonitor(pm); cloneCommand.setCloneSubmodules(true); cloneCommand.call(); pm.clear(); pw.write("\r"); pw.write(StringUtils.repeat(' ',prefix.length())); pw.write("\r"); pw.flush(); } catch (GitAPIException e) { throw new Ap3Exception("Unable to retrieve base templates", e); } }
if (!gitDir.exists()) { if (remote) { new CloneCommand().setCredentialsProvider(provider).setRemote("origin").setBranch("master").setURI(gitUrl).setDirectory(baseDir).call(); git.branchCreate().setName(branchName).call(); git.checkout().setName(branchName).call();