sekhar reddy
sekhar reddy

Reputation: 21

How to download files from Git Repository using Java code

I have to download files from Git hub and store them in local file system using java. Can somebody tell me if there is any api to do that?

Upvotes: 0

Views: 2262

Answers (1)

PartyPancakes
PartyPancakes

Reputation: 61

Check out JGit: https://www.eclipse.org/jgit/. The code should be something like:

Git.cloneRepository()
        .setURI("https://github.com/...")
        .setDirectory(Paths.get("/path/to/local/").toFile())
        .call(); 

Upvotes: 1

Related Questions