跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 22.6.1, which is no longer the latest release. See the latest release.

Get commit comparison information

GET
/repos/{owner}/{repo}/compare/{basehead}
curl --request GET \
--url https://gitea.example.com/api/v1/repos/example/example/compare/example \
--header 'Authorization: Basic <credentials>'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

basehead
required
string

Compare two branches or commits

Media typeapplication/json
Compare represents a comparison between two commits.
object
commits
Array<object>
Commit contains information generated from a Git commit.
object
author

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s gitea page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
commit
RepoCommit contains information of a commit in the context of a repository.
object
author
CommitUser contains information of a user in the context of a commit.
object
date
string
email
string format: email
name
string
committer
CommitUser contains information of a user in the context of a commit.
object
date
string
email
string format: email
name
string
message
string
tree
CommitMeta contains meta information of a commit in terms of API.
object
created
string format: date-time
sha
string
url
string
url
string
verification

PayloadCommitVerification represents the GPG verification of a commit

object
payload
string
reason
string
signature
string
signer

PayloadUser represents the author or committer of a commit

object
email
string format: email
name

Full name of the commit author

string
username
string
verified
boolean
committer

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s gitea page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
created
string format: date-time
files
Array<object>

CommitAffectedFiles store information about files affected by the commit

object
filename
string
status
string
html_url
string
parents
Array<object>
CommitMeta contains meta information of a commit in terms of API.
object
created
string format: date-time
sha
string
url
string
sha
string
stats

CommitStats is statistics for a RepoCommit

object
additions
integer format: int64
deletions
integer format: int64
total
integer format: int64
url
string
total_commits
integer format: int64
Example
{
"commits": [
{
"author": {
"login_name": "empty"
},
"committer": {
"login_name": "empty"
}
}
]
}

APINotFound is a not found empty response

Media typeapplication/json