that I need to get all commits from a remote repository.
This is how I clone a repository to a local system, but it's not a good idea to download all files because there is so much.
git = Git.cloneRepository().setURI(repo).setDirectory(pathGit).call();
File pathRepo = new File(pathGit.getPath() + "/.git");
repository = FileRepositoryBuilder.create(pathRepo);
How to resolve this issue?