List of usage examples for org.eclipse.jgit.api Git archive
public ArchiveCommand archive()
From source file:org.jenkinsci.plugins.os_ci.utils.GitClient.java
License:Apache License
public static void archive() throws GitAPIException { String localPath, remotePath; Repository localRepo;/*from w ww . j a v a2s . co m*/ Git git; try { localPath = "C:\\Users\\agrosmar\\git\\gitTry"; // remotePath = "git@github.com:me/mytestrepo.git"; localRepo = new FileRepository(localPath + "/.git"); git = new Git(localRepo); // "http://gitlab.cisco.com/control-plane-ci/deployment-scripts/blob/master/GLOBAL FileOutputStream out = new FileOutputStream(new File("c://git.zip")); git.archive().setTree(localRepo.resolve("")).setFormat("zip").setOutputStream(out).call(); } catch (Exception e) { e.printStackTrace(); } // ObjectId tree = null; }