API
tryapis.com
Find anything
⌘ K
GitHub API Endpoints
actions
activity
apps
billing
checks
code-scanning
codes-of-conduct
emojis
enterprise-admin
gists
git
gitignore
interactions
issues
licenses
markdown
meta
migrations
oauth-authorizations
orgs
packages
projects
pulls
rate-limit
reactions
repos
List organization repositories

GET

Create an organization repository

POST

Get a repository

GET

Update a repository

PATCH

Delete a repository

DELETE

List all autolinks of a repository

GET

Create an autolink reference for a repository

POST

Get an autolink reference of a repository

GET

Delete an autolink reference from a repository

DELETE

Enable automated security fixes

PUT

Disable automated security fixes

DELETE

List branches

GET

Get a branch

GET

Get branch protection

GET

Update branch protection

PUT

Delete branch protection

DELETE

Get admin branch protection

GET

Set admin branch protection

POST

Delete admin branch protection

DELETE

Get pull request review protection

GET

Update pull request review protection

PATCH

Delete pull request review protection

DELETE

Get commit signature protection

GET

Create commit signature protection

POST

Delete commit signature protection

DELETE

Get status checks protection

GET

Update status check protection

PATCH

Remove status check protection

DELETE

Get all status check contexts

GET

Add status check contexts

POST

Set status check contexts

PUT

Remove status check contexts

DELETE

Get access restrictions

GET

Delete access restrictions

DELETE

Get apps with access to the protected branch

GET

Add app access restrictions

POST

Set app access restrictions

PUT

Remove app access restrictions

DELETE

Get teams with access to the protected branch

GET

Add team access restrictions

POST

Set team access restrictions

PUT

Remove team access restrictions

DELETE

Get users with access to the protected branch

GET

Add user access restrictions

POST

Set user access restrictions

PUT

Remove user access restrictions

DELETE

Rename a branch

POST

List repository collaborators

GET

Check if a user is a repository collaborator

GET

Add a repository collaborator

PUT

Remove a repository collaborator

DELETE

Get repository permissions for a user

GET

List commit comments for a repository

GET

Get a commit comment

GET

Update a commit comment

PATCH

Delete a commit comment

DELETE

List commits

GET

List branches for HEAD commit

GET

List commit comments

GET

Create a commit comment

POST

List pull requests associated with a commit

GET

Get a commit

GET

Get the combined status for a specific reference

GET

List commit statuses for a reference

GET

Get community profile metrics

GET

Compare two commits

GET

Get repository content

GET

Create or update file contents

PUT

Delete a file

DELETE

List repository contributors

GET

List deployments

GET

Create a deployment

POST

Get a deployment

GET

Delete a deployment

DELETE

List deployment statuses

GET

Create a deployment status

POST

Get a deployment status

GET

Create a repository dispatch event

POST

Get all environments

GET

Get an environment

GET

Create or update an environment

PUT

Delete an environment

DELETE

List forks

GET

Create a fork

POST

List repository webhooks

GET

Create a repository webhook

POST

Get a repository webhook

GET

Update a repository webhook

PATCH

Delete a repository webhook

DELETE

Get a webhook configuration for a repository

GET

Update a webhook configuration for a repository

PATCH

List deliveries for a repository webhook

GET

Get a delivery for a repository webhook

GET

Redeliver a delivery for a repository webhook

POST

Ping a repository webhook

POST

Test the push repository webhook

POST

List repository invitations

GET

Update a repository invitation

PATCH

Delete a repository invitation

DELETE

List deploy keys

GET

Create a deploy key

POST

Get a deploy key

GET

Delete a deploy key

DELETE

List repository languages

GET

Enable Git LFS for a repository

PUT

Disable Git LFS for a repository

DELETE

Sync a fork branch with the upstream repository

POST

Merge a branch

POST

Get a GitHub Pages site

GET

Create a GitHub Pages site

POST

Update information about a GitHub Pages site

PUT

Delete a GitHub Pages site

DELETE

List GitHub Pages builds

GET

Request a GitHub Pages build

POST

Get latest Pages build

GET

Get GitHub Pages build

GET

Get a DNS health check for GitHub Pages

GET

Get a repository README

GET

Get a repository README for a directory

GET

List releases

GET

Create a release

POST

Get a release asset

GET

Update a release asset

PATCH

Delete a release asset

DELETE

Generate release notes content for a release

POST

Get the latest release

GET

Get a release by tag name

GET

Get a release

GET

Update a release

PATCH

Delete a release

DELETE

List release assets

GET

Upload a release asset

POST

Get the weekly commit activity

GET

Get the last year of commit activity

GET

Get all contributor commit activity

GET

Get the weekly commit count

GET

Get the hourly commit count for each day

GET

Create a commit status

POST

List repository tags

GET

Download a repository archive (tar)

GET

List repository teams

GET

Get all repository topics

GET

Replace all repository topics

PUT

Get repository clones

GET

Get top referral paths

GET

Get top referral sources

GET

Get page views

GET

Transfer a repository

POST

Check if vulnerability alerts are enabled for a repository

GET

Enable vulnerability alerts

PUT

Disable vulnerability alerts

DELETE

Download a repository archive (zip)

GET

Create a repository using a template

POST

List public repositories

GET

List repositories for the authenticated user

GET

Create a repository for the authenticated user

POST

List repository invitations for the authenticated user

GET

Accept a repository invitation

PATCH

Decline a repository invitation

DELETE

List repositories for a user

GET

scim
search
secret-scanning
teams
users

GET

https://api.github.com/repos/owner/repo/compare/basehead

The basehead param is comprised of two parts: base and head. Both must be branch names in repo. To compare branches across other repositories in the same network as repo, use the format <USERNAME>:branch.

The response from the API is equivalent to running the git log base..head command; however, commits are returned in chronological order. Pass the appropriate media type to fetch diff and patch formats.

The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a renamed status have a previous_filename field showing the previous filename of the file, and files with a modified status have a patch field showing the changes made to the file.

Working with large comparisons

To process a response with a large number of commits, you can use (per_page or page) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "Traversing with pagination."

When calling this API without any paging parameters (per_page or page), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest.

Signature verification object

The response will include a verification object that describes the result of verifying the commit's signature. The following fields are included in the verification object:

| Name | Type | Description | | ---- | ---- | ----------- | | verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. | | reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. | | signature | string | The signature that was extracted from the commit. | | payload | string | The value that was signed. |

These are the possible values for reason in the verification object:

| Value | Description | | ----- | ----------- | | expired_key | The key that made the signature is expired. | | not_signing_key | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | gpgverify_error | There was an error communicating with the signature verification service. | | gpgverify_unavailable | The signature verification service is currently unavailable. | | unsigned | The object does not include a signature. | | unknown_signature_type | A non-PGP signature was found in the commit. | | no_user | No user was associated with the committer email address in the commit. | | unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. | | bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. | | unknown_key | The key that made the signature has not been registered with any user's account. | | malformed_signature | There was an error parsing the signature. | | invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | valid | None of the above errors applied, so the signature is considered to be verified. |

Scopes requested: user, public_repo, repo, notifications, gist
Authorization
tryapis.com never stores your requests or responses