Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Getting repository contents using GitHub API

I know there is an API for getting repository content. But my use case is I need to get the whole repository and display it in my UI like GitHub UI. Similar to GitHub UI, I need my repository to be displayed in my UI. Is there any API I can use to get the whole repository so I can display that in my UI.

I tried this API.

curl \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  https://api.github.com/repos/OWNER/REPO/zipball/REF

But it gives separate file contents. I need the whole repo.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Getting the all repository remains easier with a simple git clone. No need for an API call there.

If, as mentioned in this 2016 octokit issue, you cannot clone through GitHub API, you could use libgit2sharp to integrate the clone operation in your application.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading