Alexander Strigunov
Alexander Strigunov

Reputation: 9

Fetch LFS file from remote to new local repository with JGit

I want to fetch remote repo with LFS files with FetchCommand to newly created bare repository.

I've tried something like that:

try (Git git = new Git(repository)) {
    FetchResult result = git.fetch()
        .setRemote(URL)
        .setRefSpecs(refSpecs)
        .setProgressMonitor(progressMonitor)
        .setCredentialsProvider(credentials)
        .call();
}

This clone all data, but ignore lfs directory at all. I thought i should make something like InstallBuiltinLfsCommand to firstly generate git lfs install and then to fetch, but it didn't help. What is the right way to get lfs files in such case?

Upvotes: 0

Views: 73

Answers (0)

Related Questions