hub4j / github-api

Java API for GitHub
https://github-api.kohsuke.org/
MIT License
1.13k stars 723 forks source link

Need documentation for how to clone a git repo to the disk #196

Closed madhephaestus closed 8 years ago

madhephaestus commented 9 years ago

I can not find the API equivalent of 'git clone .git' to pull the full contents of a repository to the local disk. I would also like to read from the dist a repository for local caching of files. Is this possible with github-api?

KostyaSha commented 9 years ago

Github is only library to API, if you learn github api pages you will see that it provides only url to git repository. For git you can use jgit.

kohsuke commented 8 years ago

As Kostya says, GHRepository.gitHttpTransportUrl() is where this library ends.

madhephaestus commented 8 years ago

In case someone is looking for how to do this, you can use JGIT and github-api together like this:

https://github.com/NeuronRobotics/bowler-script-kernel/blob/f1cc5473c008b9c5d6b82404b1dfc6f6b0e35c84/src/main/java/com/neuronrobotics/bowlerstudio/scripting/ScriptingEngine.java#L461