Last active
December 16, 2015 19:39
-
-
Save keesun/5486780 to your computer and use it in GitHub Desktop.
jgit clone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void cloneRepository(Project originalProject, Project forkingProject) throws GitAPIException, IOException { | |
String url = // original project's git url | |
String directory = "repo/git/" + forkingProject.owner + "/" + forkingProject.name; | |
Git.cloneRepository() | |
.setURI(url) | |
.setDirectory(new File(directory)) | |
.setCloneAllBranches(true) | |
.call(); | |
forkingProject.repositoryUrl = directory + "/.git"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment