Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 354 Bytes

java-jgit-clone-repository.md

File metadata and controls

12 lines (8 loc) · 354 Bytes

Tags: java|jgit Title: Java: Using JGit to clone a repository

Git.cloneRepository()
	.setURI(remoteRepo)
	.setDirectory(dir)
	.call();

remoteRepo will be something like "git@github.com:denevell/BlogPosts.git" and dir is a File object stating where to put the new repository.

If the directory doesn't exist, you must create it with dir.mkdirs();