Commits Comparison
GET/api/v5/repos/:owner/:repo/compare/:base...:head
Request
Path Parameters
owner stringrequired
Repository space address (address path of the enterprise, organization, or individual)
repo stringrequired
Repository path (path)
base stringrequired
The starting point for comparison. Commit SHA, branch name, or tag name.
head stringrequired
The end point for comparison. Can be a commit SHA, branch name, or tag name.
Query Parameters
access_token string
User authorization code
straight boolean
Whether to perform a direct comparison. Defaults to false.
suffix string
Filter files by file extension, such as .txt. Affects only files.
Responses
- 200
Successful Response
Response Headers
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
- Array [
- ]
- Array [
- ]
- Array [
- ]
base_commit object
urlstring
shastring
html_urlstring
comments_urlstring
commit object
author object
namestring
datestring
emailstring
committer object
namestring
datestring
emailstring
tree object
shastring
urlstring
messagestring
author object
namestring
idinteger
loginstring
typestring
committer object
namestring
idinteger
loginstring
typestring
parents object[]
shastring
urlstring
merge_base_commit object
urlstring
shastring
html_urlstring
comments_urlstring
commit object
author object
namestring
datestring
emailstring
committer object
namestring
datestring
emailstring
tree object
shastring
urlstring
messagestring
author object
namestring
idinteger
loginstring
typestring
committer object
namestring
idinteger
loginstring
typestring
parents object[]
shastring
urlstring
commits object[]
shastring
commit object
author object
namestring
datestring
emailstring
committer object
namestring
datestring
emailstring
messagestring
author object
namestring
idinteger
loginstring
committer object
namestring
idinteger
loginstring
files object[]
shastring
filenamestring
statusstring
additionsinteger
deletionsinteger
changesinteger
blob_urlstring
raw_urlstring
patchstring
truncatedinteger
truncatedinteger
{
"base_commit": {
"url": "string",
"sha": "string",
"html_url": "string",
"comments_url": "string",
"commit": {
"author": {
"name": "string",
"date": "string",
"email": "string"
},
"committer": {
"name": "string",
"date": "string",
"email": "string"
},
"tree": {
"sha": "string",
"url": "string"
},
"message": "string"
},
"author": {
"name": "string",
"id": 0,
"login": "string",
"type": "string"
},
"committer": {
"name": "string",
"id": 0,
"login": "string",
"type": "string"
},
"parents": [
{
"sha": "string",
"url": "string"
}
]
},
"merge_base_commit": {
"url": "string",
"sha": "string",
"html_url": "string",
"comments_url": "string",
"commit": {
"author": {
"name": "string",
"date": "string",
"email": "string"
},
"committer": {
"name": "string",
"date": "string",
"email": "string"
},
"tree": {
"sha": "string",
"url": "string"
},
"message": "string"
},
"author": {
"name": "string",
"id": 0,
"login": "string",
"type": "string"
},
"committer": {
"name": "string",
"id": 0,
"login": "string",
"type": "string"
},
"parents": [
{
"sha": "string",
"url": "string"
}
]
},
"commits": [
{
"sha": "string",
"commit": {
"author": {
"name": "string",
"date": "string",
"email": "string"
},
"committer": {
"name": "string",
"date": "string",
"email": "string"
},
"message": "string"
},
"author": {
"name": "string",
"id": 0,
"login": "string"
},
"committer": {
"name": "string",
"id": 0,
"login": "string"
}
}
],
"files": [
{
"sha": "string",
"filename": "string",
"status": "string",
"additions": 0,
"deletions": 0,
"changes": 0,
"blob_url": "string",
"raw_url": "string",
"patch": "string",
"truncated": 0
}
],
"truncated": 0
}
{
"base_commit": {
"url": "https://api.gitcode.com/api/v5/repos/owner-test/secure-issue/commits/17922544024484084e2b6218eb0d46d76f354ffa",
"sha": "17922544024484084e2b6218eb0d46d76f354ffa",
"html_url": "https://test.gitcode.net/owner-test/secure-issue/commit/17922544024484084e2b6218eb0d46d76f354ffa",
"comments_url": "https://test.gitcode.net/api/v5/repos/owner-test/secure-issue/commits/17922544024484084e2b6218eb0d46d76f354ffa/comments",
"commit": {
"author": {
"name": "malongge5",
"date": "2024-08-13T11:34:35Z",
"email": "malongge5@noreply.gitcode.com"
},
"committer": {
"name": "malongge5",
"date": "2024-08-13T11:34:35Z",
"email": "malongge5@noreply.gitcode.com"
},
"tree": {
"sha": "4e12f62b7fe2f78cb7c1b088e8f7e797a8c898a3",
"url": "https://api.gitcode.com/repos/owner-test/secure-issue/git/trees/4e12f62b7fe2f78cb7c1b088e8f7e797a8c898a3"
},
"message": "new: Added file test.py"
},
"author": {
"name": "malongge5",
"id": 953,
"login": "malongge5",
"type": "User"
},
"committer": {
"name": "malongge5",
"id": 953,
"login": "malongge5",
"type": "User"
},
"parents": [
{
"sha": "7ea40eef5f96c3f263f17438b294a6ea9b771cc5",
"url": "https://api.gitcode.com/api/v5/repos/owner-test/secure-issue/commits/7ea40eef5f96c3f263f17438b294a6ea9b771cc5"
}
]
},
"merge_base_commit": {
"url": "https://api.gitcode.com/api/v5/repos/owner-test/secure-issue/commits/17922544024484084e2b6218eb0d46d76f354ffa",
"sha": "17922544024484084e2b6218eb0d46d76f354ffa",
"html_url": "https://test.gitcode.net/owner-test/secure-issue/commit/17922544024484084e2b6218eb0d46d76f354ffa",
"comments_url": "https://test.gitcode.net/api/v5/repos/owner-test/secure-issue/commits/17922544024484084e2b6218eb0d46d76f354ffa/comments",
"commit": {
"author": {
"name": "malongge5",
"date": "2024-08-13T11:34:35Z",
"email": "malongge5@noreply.gitcode.com"
},
"committer": {
"name": "malongge5",
"date": "2024-08-13T11:34:35Z",
"email": "malongge5@noreply.gitcode.com"
},
"tree": {
"sha": "4e12f62b7fe2f78cb7c1b088e8f7e797a8c898a3",
"url": "https://api.gitcode.com/repos/owner-test/secure-issue/git/trees/4e12f62b7fe2f78cb7c1b088e8f7e797a8c898a3"
},
"message": "new: Added file test.py"
},
"author": {
"name": "malongge5",
"id": 953,
"login": "malongge5",
"type": "User"
},
"committer": {
"name": "malongge5",
"id": 953,
"login": "malongge5",
"type": "User"
},
"parents": [
{
"sha": "7ea40eef5f96c3f263f17438b294a6ea9b771cc5",
"url": "https://api.gitcode.com/api/v5/repos/owner-test/secure-issue/commits/7ea40eef5f96c3f263f17438b294a6ea9b771cc5"
}
]
},
"commits": [
{
"sha": "97fd5a05e18bcd5b633a279fd7d395784d272321",
"commit": {
"author": {
"name": "malongge5",
"date": "2024-09-09T07:29:23Z",
"email": "malongge5@noreply.gitcode.com"
},
"committer": {
"name": "malongge5",
"date": "2024-09-09T07:29:23Z",
"email": "malongge5@noreply.gitcode.com"
},
"message": "new: Added file bbb.rs"
},
"author": {
"name": "malongge5",
"id": 953,
"login": "malongge5"
},
"committer": {
"name": "malongge5",
"id": 953,
"login": "malongge5"
}
}
],
"files": [
{
"sha": "6533e5c4585eb91faa9331b8de6b22f9ff31d387",
"filename": "bbb.rs",
"status": "added",
"additions": 3,
"deletions": 0,
"changes": 3,
"blob_url": "https://test.gitcode.net/owner-test/secure-issue/blob/6533e5c4585eb91faa9331b8de6b22f9ff31d387/bbb.rs",
"raw_url": "https://test.gitcode.net/owner-test/secure-issue/raw/6533e5c4585eb91faa9331b8de6b22f9ff31d387/bbb.rs",
"patch": "@@ -0,0 +1,3 @@\n+\n+\n+println!(\"hello\")\n\\ No newline at end of file\n",
"truncated": false
}
],
"truncated": false
}