Pablo Fuers
Pablo Fuers

Reputation: 11

How do I create a "Revision page" with the GitHub API?

I would like to create a "Revision page" where the people can see on what I've been working using GitHub there's an example about what I mean:

"Revision Page"

It is supposed to show the commits from my GitHub repository.

Upvotes: 1

Views: 43

Answers (1)

dmcquiggin
dmcquiggin

Reputation: 3379

A) More information is required

Firstly, could you clarify if it is your intention to

  1. Show the Commit history for a single repository, or
  2. You wish to show your commit activity across multiple repositories

Also:

  1. You wish to have this information displayed on Github, or
  2. You wish to have this information displayed on an external site.

B) Displaying information on GitHub

If the intention is a combination of 1 and 3, then my first suggestion would be to check the existing functionality of GitHub, which has such a feature built-in.

This can be accessed by navigating to your repository, and simply clicking the Commits button. An example of the results can be found here:

Example GitHub Commit History

C) Displaying information on an external site

As you mention that you have limited experience with PHP, I would certainly start by evaluating GitList:

GitList allows you to browse repositories using your favorite browser, viewing files under different revisions, commit history and diffs. GitList is free and open source software, written in PHP, on top of Silex and the Twig template engine.

If you feel confident that you could create your own solution to display the information in an external web page, then you should begin by familiarising yourself with the GitHub Developer Documentation, and specifically:

List commits on a repository

It is also worth examining the following article and existing GitHub project in order to enhance your knowledge:

How to Use Github’s API with PHP (SitePòint Article with code)

GitHub PHP Client (GitHub Project)

It may be that you can clone one of these projects, strip it down to the features essential for your needs, and customise the UI.

Upvotes: 2

Related Questions