# commit-comparison

From **GitHub v3 REST API**.

Commit Comparison

- Type: `object`

## Properties

### `ahead_by`

- Required: true
- Type: `integer`
- Example: `4`

### `base_commit`

- Required: true
- Type: `object`

Commit

### `behind_by`

- Required: true
- Type: `integer`
- Example: `5`

### `commits`

- Required: true
- Type: `array`

### `diff_url`

- Required: true
- Type: `string`
- Format: `uri`
- Example: `https://github.com/octocat/Hello-World/compare/master...topic.diff`

### `files`

- Required: false
- Type: `array`

### `html_url`

- Required: true
- Type: `string`
- Format: `uri`
- Example: `https://github.com/octocat/Hello-World/compare/master...topic`

### `merge_base_commit`

- Required: true
- Type: `object`

Commit

### `patch_url`

- Required: true
- Type: `string`
- Format: `uri`
- Example: `https://github.com/octocat/Hello-World/compare/master...topic.patch`

### `permalink_url`

- Required: true
- Type: `string`
- Format: `uri`
- Example: `https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17`

### `status`

- Required: true
- Type: `string`
- Example: `ahead`
- Allowed values: `"diverged"`, `"ahead"`, `"behind"`, `"identical"`

### `total_commits`

- Required: true
- Type: `integer`
- Example: `6`

### `url`

- Required: true
- Type: `string`
- Format: `uri`
- Example: `https://api.github.com/repos/octocat/Hello-World/compare/master...topic`

## JSON Schema

```json
{"description":"Commit Comparison","properties":{"ahead_by":{"example":4,"type":"integer"},"base_commit":{"$ref":"#/components/schemas/commit"},"behind_by":{"example":5,"type":"integer"},"commits":{"items":{"$ref":"#/components/schemas/commit"},"type":"array"},"diff_url":{"example":"https://github.com/octocat/Hello-World/compare/master...topic.diff","format":"uri","type":"string"},"files":{"items":{"$ref":"#/components/schemas/diff-entry"},"type":"array"},"html_url":{"example":"https://github.com/octocat/Hello-World/compare/master...topic","format":"uri","type":"string"},"merge_base_commit":{"$ref":"#/components/schemas/commit"},"patch_url":{"example":"https://github.com/octocat/Hello-World/compare/master...topic.patch","format":"uri","type":"string"},"permalink_url":{"example":"https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17","format":"uri","type":"string"},"status":{"enum":["diverged","ahead","behind","identical"],"example":"ahead","type":"string"},"total_commits":{"example":6,"type":"integer"},"url":{"example":"https://api.github.com/repos/octocat/Hello-World/compare/master...topic","format":"uri","type":"string"}},"required":["url","html_url","permalink_url","diff_url","patch_url","base_commit","merge_base_commit","status","ahead_by","behind_by","total_commits","commits"],"title":"Commit Comparison","type":"object"}
```
