private GitRepository cloneGitRepository(final TransportConfigCallback transportCallback,
                                             final CredentialsProvider[] providers) throws Exception {
        val cloneCommand = Git.cloneRepository()
            .setProgressMonitor(new LoggingGitProgressMonitor())
            .setURI(repositoryUri)
            .setDirectory(repositoryDirectory.getFile())
            .setBranch(activeBranch)
            .setTimeout((int) timeoutInSeconds)
            .setTransportConfigCallback(transportCallback)
            .setCredentialsProvider(new ChainingCredentialsProvider(providers));

        if (!StringUtils.hasText(branchesToClone) || "*".equals(branchesToClone)) {
            cloneCommand.setCloneAllBranches(true);
        } else {
            cloneCommand.setBranchesToClone(StringUtils.commaDelimitedListToSet(branchesToClone)
                .stream()
                .map(GitRepositoryBuilder::getBranchPath)
                .collect(Collectors.toList()));
        }
        LOGGER.debug("Cloning repository to [{}] with branch [{}]", repositoryDirectory, activeBranch);
        return new DefaultGitRepository(cloneCommand.call(), credentialsProviders,
            transportCallback, timeoutInSeconds, signCommits, rebase);
    }
Build transport config callback.

@return the transport config callback
support/cas-server-support-git-core/src/main/java/org/apereo/cas/git/GitRepositoryBuilder.java