简体   繁体   中英

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?

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(); 

undefined method?

enter image description here

The reference lib information is as follows: org.eclipse.jgit-6.2.0.202206071550-r.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM