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

Get a list of all commits from a repository

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

Owner of the repo

repo
required
string

Name of the repo

sha
string

SHA or branch to start listing commits from (usually ‘master’)

path
string

Filepath of a file/dir

since
string format: date-time

Only commits after this date will be returned (ISO 8601 format)

until
string format: date-time

Only commits before this date will be returned (ISO 8601 format)

stat
boolean

Include diff stats for every commit (disable for speedup, default ‘true’)

verification
boolean

Include verification for every commit (disable for speedup, default ‘true’)

files
boolean

Include a list of affected files for every commit (disable for speedup, default ‘true’)

page
integer

Page number of results to return (1-based)

limit
integer

Page size of results (ignored if used with ‘path’)

not
string

Commits that match the given specifier will not be listed.

CommitList

Media typeapplication/json
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
Example
[
{
"author": {
"login_name": "empty"
},
"committer": {
"login_name": "empty"
}
}
]
X-HasMore
boolean

True if there is another page

X-Page
integer format: int64

The current page

X-PageCount
integer format: int64

Total number of pages

X-PerPage
integer format: int64

Commits per page

X-Total
integer format: int64

Total commit count

APINotFound is a not found empty response

Media typeapplication/json

EmptyRepository

Media typeapplication/json

APIError is an api error with a message

object
message
string
url
string
Examplegenerated
{
"message": "example",
"url": "example"
}