Skip to content

Commits Extensions

Forgejo’s built-in commit API does not support full-text search. The proxy adds a search endpoint that queries commit messages, author names, and SHAs.

MethodEndpointDescription
GET/api/v1/repos/{owner}/{repo}/git/commits/searchSearch commits in a repository
ParameterDescription
ownerRepository owner (user or organisation name)
repoRepository name
ParameterTypeDefaultDescription
qstring(required)Search term — matched against commit messages, author names, and SHAs
pageinteger1Page number for pagination
limitinteger20Number of results per page
Terminal window
# Search for commits mentioning "fix authentication"
curl -H 'Authorization: token YOUR_TOKEN' \
'https://forgejo-proxy.hochguertel.work/api/v1/repos/myorg/myrepo/git/commits/search?q=fix+authentication'
# Search by author name, page 2
curl -H 'Authorization: token YOUR_TOKEN' \
'https://forgejo-proxy.hochguertel.work/api/v1/repos/myorg/myrepo/git/commits/search?q=tobias&page=2&limit=10'
# Search by partial SHA
curl -H 'Authorization: token YOUR_TOKEN' \
'https://forgejo-proxy.hochguertel.work/api/v1/repos/myorg/myrepo/git/commits/search?q=a3f9c2'

Returns an array of commit objects compatible with Forgejo’s commit schema:

[
{
"sha": "a3f9c2d1e4b5...",
"commit": {
"message": "fix: correct authentication token handling",
"author": {
"name": "Tobias Hochgürtel",
"email": "tobias@example.com",
"date": "2024-11-01T10:30:00Z"
}
},
"html_url": "https://forgejo.example.com/myorg/myrepo/commit/a3f9c2d1e4b5..."
}
]