Created
February 9, 2018 04:15
-
-
Save sangramanand/1aed1fa738b678c94bdbb81f871195b9 to your computer and use it in GitHub Desktop.
This file contains 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
package com.tut.jgit; | |
import java.io.File; | |
import org.eclipse.jgit.api.CloneCommand; | |
import org.eclipse.jgit.api.Git; | |
import org.eclipse.jgit.api.errors.GitAPIException; | |
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; | |
public class GitTester { | |
public static void main(String[] args) { | |
System.out.println("Hello World!!!"); | |
File gitDir = new File("D:\\anand\\git_test_repos"); | |
try { | |
CloneCommand cloneCommand = Git.cloneRepository(); | |
cloneCommand.setURI("https://github.com/sangramanand/JP-Multithreading.git"); | |
cloneCommand.setDirectory(gitDir); | |
cloneCommand.setCredentialsProvider( new UsernamePasswordCredentialsProvider( "sangramanand", "indavest*38" ) ); | |
cloneCommand.call(); | |
System.out.println("done"); | |
} catch (GitAPIException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment