Java: Using JGit to clone a repository

So

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();

java git

Edit on github
comments powered by Disqus
Click me