public class git {
//public static Object textView;
//public static void main(String[] args) throws IOException,GitAPIException
//{
String repoUrl = "https://bitbucket_integration@bitbucket.org/bitbucket_integration/bitbucket_integration.git";
String cloneDirectoryPath = "G:\\tmp\\test1"; // Ex.in windows c:\\gitProjects\SpringBootMongoDbCRUD\
public void cloneRepo(String repoUrl, String cloneDirectoryPath, String User, String password) throws GitAPIException
{
try {
System.out.println("Cloning "+repoUrl+" into "+repoUrl);
Git.cloneRepository()
.setURI(repoUrl)
.setDirectory(Paths.get(cloneDirectoryPath).toFile())
.setCredentialsProvider( new UsernamePasswordCredentialsProvider(User,password ) )
.call();
System.out.println("Completed Cloning");
} catch (GitAPIException e) {
System.out.println("Exception occurred while cloning repo");
e.printStackTrace();
}
}
public static void main(String[] args) throws IOException,GitAPIException
{
}