Get a list of all commits from a repository
const url = 'https://gitea.com/api/v1/repos/example/example/commits';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://gitea.com/api/v1/repos/example/example/commits \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Owner of the repo
Name of the repo
Query Parameters
Section titled “Query Parameters”SHA or branch to start listing commits from (usually ‘master’)
Filepath of a file/dir
Only commits after this date will be returned (ISO 8601 format)
Only commits before this date will be returned (ISO 8601 format)
Include diff stats for every commit (disable for speedup, default ‘true’)
Include verification for every commit (disable for speedup, default ‘true’)
Include a list of affected files for every commit (disable for speedup, default ‘true’)
Page number of results to return (1-based)
Page size of results (ignored if used with ‘path’)
Commits that match the given specifier will not be listed.
Responses
Section titled “Responses”CommitList
object
User represents a user
object
Is user active
URL to the user’s avatar
The user’s description
User counts
The user’s full name
URL to the user’s gitea page
The user’s id
Is the user an administrator
User locale
The user’s location
Login of the user, same as username
Identifier of the user, provided by the external authenticator (if configured)
Is user login prohibited
Is user restricted
The ID of the user’s Authentication Source
User visibility level option: public, limited, private
The user’s website
object
object
Date is the commit date in string format
Name is the person’s name
object
Date is the commit date in string format
Name is the person’s name
Message is the commit message
object
SHA is the commit SHA hash
URL is the API URL for the commit
URL is the API URL for the commit
PayloadCommitVerification represents the GPG verification of a commit
object
The signed payload content
The reason for the verification status
The GPG signature of the commit
PayloadUser represents the author or committer of a commit
object
Full name of the commit author
Username of the user
Whether the commit signature is verified
User represents a user
object
Is user active
URL to the user’s avatar
The user’s description
User counts
The user’s full name
URL to the user’s gitea page
The user’s id
Is the user an administrator
User locale
The user’s location
Login of the user, same as username
Identifier of the user, provided by the external authenticator (if configured)
Is user login prohibited
Is user restricted
The ID of the user’s Authentication Source
User visibility level option: public, limited, private
The user’s website
Files contains information about files affected by the commit
CommitAffectedFiles store information about files affected by the commit
object
Filename is the path of the affected file
Status indicates how the file was affected (added, modified, deleted)
HTMLURL is the web URL for viewing the commit
Parents contains the parent commit information
object
SHA is the commit SHA hash
URL is the API URL for the commit
SHA is the commit SHA hash
CommitStats is statistics for a RepoCommit
object
Additions is the number of lines added
Deletions is the number of lines deleted
Total is the total number of lines changed
URL is the API URL for the commit
Example
[ { "author": { "login_name": "empty" }, "committer": { "login_name": "empty" } }]Headers
Section titled “Headers”True if there is another page
The current page
Total number of pages
Commits per page
Total commit count
APINotFound is a not found empty response
EmptyRepository
APIError is an api error with a message
object
Message contains the error description
URL contains the documentation URL for this error
Examplegenerated
{ "message": "example", "url": "example"}