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.
Method Endpoint Description GET/api/v1/repos/{owner}/{repo}/git/commits/searchSearch commits in a repository GET/api/v1/repos/{owner}/{repo}/commits/latestGet the latest commit on a branch
Parameter Description ownerRepository owner (user or organisation name) repoRepository name
Parameter Type Default Description qstring(required) Search term — matched against commit messages, author names, and SHAs pageinteger1Page number for pagination limitinteger20Number of results per page
Parameter Type Default Description branchstringdefault branch Branch name to fetch the latest commit from
# Search for commits mentioning "fix authentication"
curl -H ' Authorization: token $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 $TOKEN ' \
' https://forgejo-proxy.hochguertel.work/api/v1/repos/myorg/myrepo/git/commits/search?q=tobias&page=2&limit=10 '
curl -H ' Authorization: token $TOKEN ' \
' https://forgejo-proxy.hochguertel.work/api/v1/repos/myorg/myrepo/git/commits/search?q=a3f9c2 '
# Get the latest commit on the default branch
curl -H ' Authorization: token $TOKEN ' \
' https://forgejo-proxy.hochguertel.work/api/v1/repos/myorg/myrepo/commits/latest '
# Get the latest commit on a specific branch
curl -H ' Authorization: token $TOKEN ' \
' https://forgejo-proxy.hochguertel.work/api/v1/repos/myorg/myrepo/commits/latest?branch=develop '
Returns an array of commit objects compatible with Forgejo’s commit schema:
"sha" : " a3f9c2d1e4b5... " ,
"message" : " fix: correct authentication token handling " ,
"name" : " Tobias Hochgürtel " ,
"email" : " tobias@example.com " ,
"date" : " 2024-11-01T10:30:00Z "
"html_url" : " https://forgejo.example.com/myorg/myrepo/commit/a3f9c2d1e4b5... "
Returns a single commit object:
"sha" : " b7e1a3f9c2d1... " ,
"message" : " chore: bump version to 1.4.2 " ,
"name" : " Tobias Hochgürtel " ,
"email" : " tobias@example.com " ,
"date" : " 2024-12-01T08:00:00Z "
"html_url" : " https://forgejo.example.com/myorg/myrepo/commit/b7e1a3f9c2d1... "