Resources Repository Get Commit
Get Commit
Get specified commit
Http Method
GET
End Point
/~api/repositories/{projectId}/commits/{commitHash}
Placeholder Description Example
{projectId} Project Id 1
{commitHash} Commit Hash 8cbec3d9eda2050a4ca0676767be3b6bf20251b8
Query Parameters
Parameter Description Required Example
field Fields to return. Unspecified fields will return as null in returned commit object No [ PARENTS , AUTHOR , COMMITTER , COMMIT_DATE , SUBJECT , BODY , FILE_CHANGES , LINE_CHANGES ]
Response
Operation Successful
Status Code
200
Response Body
Content Type
application/json
Example
{
"hash" : "string" ,
"subject" : "string" ,
"body" : "string" ,
"commitDate" : "2024-07-07T20:01:02.452+00:00" ,
"committer" : {
"name" : "string" ,
"emailAddress" : "string" ,
"when" : 1 ,
"tzOffset" : 1
}
,
"author" : {
"name" : "string" ,
"emailAddress" : "string" ,
"when" : 1 ,
"tzOffset" : 1
}
,
"parentHashes" : [ "string" ] ,
"fileChanges" : [ {
"oldPath" : "string" ,
"newPath" : "string" ,
"additions" : 1 ,
"deletions" : 1
}
]
}
Operation Failed
Status code
Status code other than 200 indicating the error type
Response Body
Error detail of content type "text/plain"
cURL Example
$ curl -u <login name>:<password or access token> -G https://git.codedune.app/~api/repositories/1/commits/8cbec3d9eda2050a4ca0676767be3b6bf20251b8 --data-urlencode field=PARENTS --data-urlencode field=AUTHOR --data-urlencode field=COMMITTER --data-urlencode field=COMMIT_DATE --data-urlencode field=SUBJECT --data-urlencode field=BODY --data-urlencode field=FILE_CHANGES --data-urlencode field=LINE_CHANGES
Please wait...
Page is in error, reload to recover